Parts of this are untested, but it should work per your request.
Code:
 on @!*:join:#:{
  set %nick $nick
  set %chan $chan
  bad.channels $nick
}

menu channel,nicklist {
  Bad Channels
  .Scan Now : bad.channels $chan
  .Set exemptions : set $+(%,exempt,.,$cid,.,$chan) $$?="Exemption status (o = ops, h = half-ops, v = voice, r = regular) Multiple letters will work"
  .Set Timed scan : {
    set bad.channel.scan $$?="Time between scans"
    if (%bad.channel.scan !isnum) && ($chr(58) !isin $v1) {
      echo 4 -a Invalid Format
      echo 12 -a Number of minutes or hh:mm:ss format only
      unset %bad.channel.scan
    }
    else {
      set $+(%,bad.channel.scan,.,$cid,.,$chan) $iif(%bad.channel.scan isnum,$v1,$iif($chr(58) isin %bad.channel.scan,$duration($v1)))
    }
    if $($+(%,bad.channel.scan,.,$cid,.,$chan),2) {
      .timerbad.channel 0 $($+(%,bad.channel.scan,.,$cid,.,$chan),2) bad.channels $chan
    }
  }
}

alias bad.channels {
  if $1 == %nick {
    .enable #bad.channels.whois
    .whois $1
  }
  else {
    unset %nick
    var %a = 1
    while %a <= $nick($1,0) && ($nick($1,%a) != $me) && !$nick($1,%a,$($+(%,exempt,.,$cid,.,$chan),2)) {
      .enable #bad.channels.whois
      .whois $nick($1,%a)
      inc %a
    }
  }
}

#bad.channels.whois off
raw 318:*:{
  .disable #bad.channels.whois
  haltdef
}
raw 319:*:{
  var %b = 1, %c = $numtok($3-,32)
  while %b <= %c {
    if $read(bad_channels.txt,w,$gettok($3-,%b,32)) && ($me isop %chan) {
      .ban -k %chan $2 2 Bad Channels detected
    }
    inc %b
  }
}
#bad.channels.whois end
 

Manual scan was available in the original code, so I didn't need to add it. Timed scan is settable by you using the Set Timed Scan option. Exemption status has been added, and will take an entry from you. o, h, v, and r are valid entries, but there's no verification that some other character hasn't been entered.
You can use something like oh (for ops and half-ops)

Ban mode 2 has been hard-coded.
Timings and exemptions are tracked on a channel by channel basis, and is multi-network ready.