Paste this in a new script file in remotes window (alt-r twice then file->new). It will ban on every channel where you have op status people who change their nicks more than 2 times in 4 seconds, or more than once a minute after that. Add 60 seconds for each nickchange, if the counter reaches 116 it'll ban them. Counters decrease with 1 each second. Ban is done in *!*user@*.host format.

on !*:NICK:{
  inc -z $+(%,nickchange.,$address) 60
  if ($($+(%,nickchange.,$address),2) > 116) {
    var %i = 1
    unset $+(%,nickchange.,$address)
    while ($comchan($newnick,%i)) {
      if ($me isop $v1) ban -k $v2 $newnick 3
      inc %i