I your script, check to make sure that there is no record looking and also that you have contact with the table.
If( not IsEmpty( table::ID)
Warning dialog och finish
My guess is that you are trying to Set Field when you dont have a connection and this will cause your freeze and you have to ForzeQuit you FMP.
You can do the If-statement quite often in your script, but you dont have to do it in between every Set Field