Yeah. Don't trap yourself.
What I do is put the New Window step inside of an IF statement.
If [Full Access] (or developer account or something else)
New Window (with escape capabilities)
New Window (full modal)
I hesitate to admit being in a similar situation so let's just say:
If by chance you are working in FileMaker 12, and you decide to create a pop up window in your script, and you decide to make it modal, and you decide to create it first off screen while you do some other steps, and you decide to test it but forget to add a step for moving it on screen, then this is how you can get out of that.
First you still have access to the File Options menu, where you can specify a script trigger, which also gives you access to Manage Scripts (which is grayed out from the script menu). You can then create a Close Window script (if you didn't already have one).
Second you still have access to the Custom Menus area, and you can create a custom menu, repurpose the Delete Record menu item (or one of the others that still are accessible) and point it to your close window script. You can also choose the custom menu that will be the default for this file on that screen.
Then use the menu to run the Delete Record command which now runs your Close Window script, Whoo Hooo!!! you didn't have to force quit FileMaker!
Don't ask me how I know this :-)
In the above situation the close window button had not been disabled.
I have a close window script. In a number of solutions I do work in off screen windows. So if your debugging or have a script quit, you have the same issue as a modal window. No acess to the close window button. The mouse just won't go to -10000 off screen. So I use the script.
In most cases I still have access to the FileMaker menu Quit option. Not graceful but should close all of the windows and quit... I think.
My first step in a modal window is just to add a tiny bit of text, close, and then make it a button ... closing.
The same with loops. My first step is to put in a developers exit or to temporely enable the escape ability which is usually of.