How to check if a Script is still running. Execute another once finished

while someScriptRunning():wait()


I am scripting in Blender 2.49 but feel free to post any Blender Version Solution. Thank You

I want to terminate and re-run a Blender python script in order to refresh my GUI widgets.
At the moment my Script can create a number of textboxes according to the number of selected Poly. But you need to exit it and run it manually after selecting other Polygons. I would like to automate this

Or is there a way to clear the GUI in blender at runtime or maybe terminate a script?