You need an "on text" event to process incoming text messages. Maybe you want to use an "on action" event as well.
Inside the event(s), you check the message for swearword matches, and in case of a match, you trigger your notification.
There's a *lot* of different matching methods one could use, and there's a lot of different ways to access a "list" of swearwords. I suggest you have a look at some of the many "badword kickers" arround - they give plenty of examples for matching methods, and for ways of storing/processing a word list. If you find a script you like, simply put your notification in place of the original "enforcing measure".
For the alert/notification there's a *lot* of options as well
Here are some of them:
- echo the notification to the active window / to the status window
- echo the notification to a dedicated ("custom") window
- trigger a text baloon ($tip)
- open a small modeless dialog ("popup") with infos about the incident (and maybe with different "reactions" to choose from)
- beep / flash / play some soundfile
- ...