Hi Matt
I had the same problem about endless loops and infinite recursion and I asked a similar question
in this post.
A way for protecting from "while(true)" could be to run the script in a separated thread, and implementing something like a watchdog monitoring the thread and deciding to kill the thread in case it is taking too long time to finish.
Another way could be to create another AppDomain (if your process has the permission to do it) and run the script there...this could protect your process to die due to a StackOverflow Exception raised in case of infinite recursion in the script to be executed.
Did you find any other solution in the while?
Bye
Alberto