why dont you just use the way built into mIRC?

View > go to the IRC tab and the check off 'keep channels open'