your statement here ~~> on *:open:?:{
...also refers to a second while loop within its commands
spamdetect $nick, must be changed. mIRC cant execute the second loop when the first one is still running, it will crash (freeze) you every time guaranteed.
Ill be back tommorrow my friend