what is your exact version of InDesign on what operating system?
Can your task be achieved with InDesign's feature set without using a script?
And if yes, could you show a screenshot of the function?
Can that be done with Acrobat's form feature at all?
I think, moving on to the next block requires pressing TAB.
It sounds to me like you're looking to create a "comb" field.
Acrobat has comb fields which separate each number or character into a separate box or block.
Is that what you mean?