You can use
ScriptEngine.Interrupt() to abort script execution based on a timeout or any other criteria.ScriptEngine.Interrupt() to abort script execution based on a timeout or any other criteria.