EDIT: fixed the code
There are multiple syntax errors in that code, such as:
A semicolon at the end of the function declaration
A missing right parenthesis at the end of the messageAll call
messageAll message parameter isn't in quotes
Also you should use the proper chat function (chatMessageAll i believe) not messageAll
and the text is being replace with the smiley.
Because that's what you're giving the messageAll function as an argument when you should be giving it %msg
Also your strReplace (the end result of which isn't even being used) has the wrong number of arguments
There have been multiple emoticon add-ons made, some should still be available. Why don't you just look at one of them.
You have already been given code proper code that replaces text with the emote picture. I have no idea what you're still trying to accomplish.