try commenting out on quit events you have and see if that helps. because unless you are on a channel with like 10,000 people on it, i don't see why mirc locks up for so long. If u are on channels with like 10,000 people on them, i'll assume ur downloading files illegally and won't help further.
If commenting out the on quit events helps, then a script can be made to make mirc ignore the on quit events when a netsplit occurs.