I had looked at this a while back and had written something in AutoHotkey that would disable the mouse. Although, the problem would occur when the process would stop in the middle, the mouse would still be disabled, so I set the script aside. I did not find any other good solutions to actually disabling user interaction, but am always curious on the topic.
Ideally, you would want to design in checks after a text box is filled in before moving on, with some Retry scopes so it will reenter the text box or click a button if it was done wrong —this has saved me many headaches. Also, if you have your process placed in a very well designed framework, then it will perform retries in a very efficient way when random occurrences occur like accidentally moving the mouse.
Alternatively, you can try to always use the SendWindowsMessage or SimulateClick options which will not rely on mouse movement. Although, this doesn’t always prove to work.