Since you've used the ^ caret and $ symbol, it'll mean that every bad word has to be masked in the beginning of a sentence and ends as it is. In other words, this code won't trigger if those bad words of your choice are scolded within a sentence.
P.S. you can shorten your kick/ban operation as such:
ban -ku900 # $nick 2 4(automatic 15 min ban)we dont use that word here now GTFO
, which does the exactly same thing as yours. You should also make sure the client running the code is opped in channel by prefixing @ to the text event. You don't want mIRC to return an error if it's not opped before kicking/banning. > on @$*:text: