Thank you for your post.
Could you clarify what you mean by "popup window"? Do you mean a popover panel? Do you mean another document window?
Could you also explain about editing a script when it is running? Whenever you make a change to a script that is running and attempt to save the script, you will get a message "Performing this action will halt the currently running script. Proceed?"