Script Dialog while loop not running some commands

Actually there is a way to achieve this with timers, but it's not recommended by GPSoft to have add-ins that run forever.

See some very old examples:

vbscript:

jscript: