1. mIRC has anti-flooding settings which should queue the messages for you.

2. The mIRC script editor has a "check brackets" button in the top right hand corner which can easily find these sorts of errors.