Good luck.
This is a very difficult thing to do.
In order to stop a paste you have to take into account three different methods of pasting. 1. Ctrl-V, 2. Clicking Edit then Paste, 3. Right mouse clicking and selecting Paste.
To make things worse, to prevent a ctrl-v paste you have to trap the event for the ctrl-v keypress so you know someone tried pasting from the keyboard.
What you would have to do is keep track of what characters you already have in the input field and trigger your script when someone presses a key in that field. YOu would then have to analyze what the current content is, make sure it is only one character higher or one character lower than the last time the event ran and also test that the remaining content of the field match what was there before.
I have played with this in the past and gotten as far as blocking Ctrl-V events but not the menu paste methods.
At my age I still learn something new every day, but I forget two others.