It doesn't require a whois, as mIRC gets the nickmodes in the /names reply you receive after joining a channel and mIRC is "tracking" all subsequent nickmode changes. However it sounds indeed like a takeover script so I won't provide working code
One may while-loop $mid($nickmode,N,1) and for every nickmode $nick(#chan,N,<nickmode>); fire strings of "-<mode>[<mode>]... <nick1> [nick2] ..." commands with the lengh of $modespl (postponing your own nick) and giving every commandline a sufficient delay (/timer) to avoid flooding yourself off the network.