Using your code I added ISWM and fixed your mistake a typo I assume, you set %text after tokenizing it to the swear words frown
Code:
on *:text:*:#:{
  if ($nick !isop #) {
    set -ln %text $strip($1-)
    tokenize 32 $read(swear.txt,1)
    scon -r if ($+(*, $* ,*) iswm % $+ text) $({,) ban -ku180 # $nick No swearing $(| halt },)
  }
}