Not bad method, its clear and easy for someone to add to that way, you might have add a color striping to the front like so to beat any added color/bold/etc changes mid word.
on *:TEXT:*:?:{
tokenize 32 $strip($1-)
if (offensiveword1 isin $1-) .close -m $nick
etc etc
one could also use
on ^*:OPEN:?:*:{
tokenize 32 $strip($1-)
if (offensiveword1 isin $1-) halt
etc etc
but this wont close a query if its already open just stop a new one opening.