The ON NICK event, as you have it, wouldn't work, as $chan returns $null in the ON NICK event. Here's how I would change that
Code:
on *:nick:{
var %a = 1, %b = $comchan($newnick,0)
while %a <= %b {
if (fuck isin $newnick) && ($comchan($newnick,%a) == #YourChannel) && ($me isop $v2) { /echo $v2 Well heck, the f word is in $nick $+ 's new nick.
inc %a
}
}