The only suggestion I have is you have to make sure the client running the code is opped in channel upon kicking by adding the @ prefix. If it's not opped, you'll get an error:> on @:TEXT:*:#: {Moreover, your code has a downfall: someone can get a kick if he or she enters anywhere in a sentence on purpose. (yes, there are boring individuals who will abuse this by getting kicked for fun; some might even spam it...)
Finally, I don't see how or why a kick is warranted since the +G mode already does the job to filter out bad words. But I don't blame you, though, since there are "kicking happy" ops about out there.