Dear god. This topic is going all over the place..
Let me try to clear some things up, without spoon feeding.
First of all, clientCmdChatMessage is a terrible function to be packaging for a chat bot. That is what is called when the server tells you that somebody has said something. You don't want to be sending messages to the server when trying to interact with the bot. Its spammy, annoying, a waste of network communication, and it takes a while when its laggy.
The solution to this is to use the function NMH_Type::Send(%this) and use %this.getValue() to get the message. Then, check if you are talking to your bot, if so, don't call the parent. That way your message wont be sent (you gotta clear the message manually though).
It seems that you don't quite understand how the syntax works, I recommend you go and read through other add-ons. I recommend events, as they usually have no datablocks, and are just pure scripting. Alternatively, go look at another programming language with similar syntax. Javascript is pretty close to Torquescript, go watch a few tutorials on youtube or something until you understand where ; ( ) and { } go.