Code:
on @*:text:*:#:{
  [color:blue]tokenize 32 $strip($1-)[/color]
  var %a = 1, %b = $0
  while %a <= %b {
    [color:blue]if ($read(swear.txt,nts,$gettok($1-,%a,32)) || $readn) {[/color]
      inc -u86400 $+(%,swear.,$address)
      .msg $chan No swearing $nick
      .msg $chan This is your $ord($($+(%,swear.,$address),2)) warning
      if $($+(%,swear.,$address),2) > 2  {
        .ban -ku300 $chan $nick Swearing
        .msg $bnick No swearing in $chan
      }
      [color:blue]return[/color]
    }
    inc %a
  }
}


Blue lines were added or edited.

First removes color codes extra from the line, people put them in to try and avoid the swearword detection.

Second was the only real fix, Russel just forgot the s (maybe w) flag, to seach for the matching word, since s flag shows only the text on the line minus the word, the line often comes back empty but found, so $readn is used to sence if a line was located.

Third added a return to exit once the first badword is detected, bit hard on someone to be told they had 3 warings all for the same line of text smile