With all due respect, you should not even be trying to do such a thing with the engine, but with the code. I know it's really annoying when somebody won't answer your question. But I'm just trying to share my experience on this, and the answer I can give you is , don't get an infinite loop, EVER!
The reason is simply because it doesn't get out, and why should anything else then the code be responsible? It shouldn't, the code is. Otherwise it's going to get really confusing when the responsibility starts shifting to places where they don't belong.