Alright, I'll try working a solution. I have another modification I want to make too, to prevent cycle-wars between two users, or with ChanServ parting after deoping you.
Btw, the On Quit issue is solved by iterating through $comchan($nick,%i) to find each of the channels they were in before quitting. $nick().pnick still works at this point, as the IAL is not updated until after the event ends, unless you use the /updatenl command.