Your problem is that you are never returning to your script.

The "$Nul = Execute($Form1.DoEvents())" line will block until an event is ready to process (I'm guessing here as I'm not a big KixForms.Net user).

You need the form to return control to the script so that you can action your own code, probably by using a timer.