Well, I tried it with exactly the code above and it works, so maybe you have a typo somewhere? I'd suggest you post your code but I suppose it contains bad language.
ETA: or maybe it's just not working like you expected? Like Lynne mentioned in the other thread, this only changes it just before a post is displayed, so there are probably some situations where the swear word would be seen (like an RSS feed maybe?). If you want to change it permanently when the post is saved (which is the way the build-in censoring works), I think you could use hook newpost_process and code like this:
PHP Code:
$censoredword = array(
'swear word1',
'swear word2'
);
$changedword = 'new word for all swears';
$post['message'] = str_ireplace($censoredword, $changedword, $post['message']);
I suppose a disadvantage to this way is that it won't change any existing swear words.