You can entirely rewrite it

not to be flippant or anything, but that would pretty much require rewriting the entire hack and, at that point, it would lose its point. Then each user would be selecting each usergroup, and then each usergroup would need permissions to see if users can ban that specific usergroup from viewing it... the more I think about it, the more my head hurts

it's complicated, dang. Something like that sounds like something you'd want custom-written for your site, not something that'd be widely used.