Also add if $nick isop $chan and $nick isvoice $chan so it will not disturbing people when chatting.
I think no need to use gettok etc but there are many ways to create it. So no comment for that.
MODE $chan +b $nick KICK $chan $nick No badwords!
TO
ban -k $chan $nick 2 No badwords!