wait_limit is the maximum time the script will wait for a MMG event before checking if anything got messed up.
I think you could lead this script into infinite iteration by changing line 152:
if ( new_count > iterations )
change the condition into something always false, like
if ( 1 == 5 )...