I'm a little confused, you know how to work sockets, but don't know basic mirc command syntax, usually its the other way around, lol.
anyways, the syntax for sending a message is:
msg #channelname Message to respond here.
if I put that as the exact message command, and the script bot was named "bot", the chat response would be
bot: Message to respond here.
You can also print out variables, and nick names, like $nick, or %variablename.
If you still have any question about simple mirc scripting commands and variable use, I'd suggest looking over the mirc help documentation, or searching online for some tutorials/wiki/databases. If you already know how to implement sockets, then help documentation or a tutorial might prove more useful to you, then back/forth question answering on a forum.