If you think a text file would be easiest for you to handle the list of words in then you can use the following text event:

on @*:text:*:#:{
  if ($nick !isop #) {
    if ($read([color:brown]file.txt[/color],rn,/^(\Q $+ $replacecs($1-,\E,\E\\E\Q,$chr(32),\E|\Q) $+ \E)$/iS)) {
      var %s = $+(%,$cid,$site,#)
      inc -u3600 $(%s)
      if ($(%s,2) < 3) .notice $nick Please don't swear! - $iif($v1 = 1,this is your first warning!,this is your second warning next time you will be banned!)
      else ban -k # $nick 2 Banned for 1day

Change file.txt to the name/path of the file containing the swears, each swear on a new line