I can see this snippet not working in a channel with say 50+ ops. As Jethero_ was saying, $modespl would be something to look into.