I dont see any text, join, or part commands, there is nothing that a cycle would trigger to freeze...
Are you sure its this script doing it?
...usually freezes come from bad loops. Loops are a good place to start looking anyhow. This script doesn't have any that would trigger on a cycle though.