You could probably find many existing scripts that will do what you want. Try searching for mIRC scripting sites on google.
Here is a simple code that will catch if someone says 2 or more swears.
on $*:TEXT:/\b(?:[color:red]ass|bitch|whore|etc[/color])\b/igS:#:if ($regml(0) >= 2) echo 4 -a OMGZ $nick is cussing too much!!
Note, this only catches individual swears, example: the above code would match "ass" but not "[censored]". To change/add words, edit the red portion above. Each word is separated by a | pipe.
-genius_at_work