Start -> Run -> wordpad -> paste code -> copy code to Scripts Editor, tab Remote (alt+r).

[*] /chans_list - Lists the bad channels.
[*] /chans_add <channel> - Adds a bad channel.
[*] /chans_rem <channel> - Removes a bad channel.

I've included a channel popup to:

- Enable/disable the script
- Add/remove a channel to the protection list

Code:
menu channel {
  Badchan Checker
  .$iif($group(#badchans) == off,$style(2)) $iif($istok(%protchans,#,32),Remove,Add) protection for #:{
    if $istok(%protchans,#,32) {
      %protchans = $remtok(%protchans,#,1,32)
      echo -ac info * Removed # from the list of protected channels
    }
    else {
      %protchans = %protchans #
      echo -ac info * Added # to the list of protected channels
    }
  }
  .$iif($group(#badchans) == on,Disable,Enable):{
    if $group(#badchans) == on) { disable #badchans | chans_save }
    else { enable #badchans | chans_load }
  }
}
[color:red]  [/color] 
#badchans on
on *!:JOIN:%protchans: .enable #chancheck | whois $nick 
on *:START: chans_load
on *:EXIT: chans_save
#badchans end
 [color:red]  [/color] 
#chancheck off
raw 318:*: haltdef | .disable #chancheck 
raw 319:*: haltdef | chans_check $2- 
raw *:*: if $istok(301 307 310 311 312 313 317 320 401,$numeric,32) { haltdef }
#chancheck end
 [color:red]  [/color] 
alias chans_noprefix var %a, %b = $regsub($1-,/(?:^|\s)([^#]+)/g,$chr(32),%a) | return %a
 [color:red]  [/color] 
alias chans_check {
  var %chans = $chans_noprefix($2-), %a = 1
  while $gettok(%chans,%a,32) {
    if $hget(chans,$v1) { chans_comkick $1 | return }
    inc %a
  }
}
 [color:red]  [/color] 
alias chans_comkick {
  var %a = $comchan($1,0), %b
  while $comchan($1,%a) {
    %b = $v1
    if $istok(%protchans,%b,32) &amp;&amp; $me isop %b &amp;&amp; $1 !isop %b {
      ban -k %b $1 2 You are on a forbidden channel. 
    }
    dec %a
  }
}
 [color:red]  [/color] 
alias chans_load {
  if !$isfile(chans.txt) {
    echo -asc info * Could not find chans.txt. Creating new file...Done.
    write chans.txt
  }
  hmake chans
  hload chans chans.txt
}
 [color:red]  [/color] 
alias chans_save hsave chans chans.txt | hfree chans
 [color:red]  [/color] 
alias chans_add {
  hadd chans $$1 1 
  echo -ac info * Added $1 to list of bad channels
}
 [color:red]  [/color] 
alias chans_rem {
  hdel chans $$1 
  echo -ac info * Deleted $1 from list of bad channels 
}
 [color:red]  [/color] 
alias chans_list {
  var %a = 1
  echo -asc info ### Listing bad channels ###
  while $hget(chans,%a).item { 
    echo -as * $v1
    inc %a
  }
}

[*] You probably already have a text file with all the bad channels in it, each on a seperate line. We'll have to convert it to make it work with the script. Add these 2 aliases, put your text file in the mircdir, change "yourfile.txt" to the actual name in the alias chans_convert, close the mIRC editor, and type /chans_convert

alias chans_convert filter -fk yourfile.txt chans_convert2
alias -l chans_convert2 write chans.txt $+($1,$lf,1)

[*] The script will only scan on channels that are in the protected list (%protchans), and while performing the comchan kick, it will also only kick from common channels who are in %protchan. I added this option because it is possible that you are an op in a channel, where they do not want to use a bad channel kicker.

Enjoy.