What is the name of the network that you want to relay messages too?
In your example you are using a $cid of 2, but you don't realise that this can change with different sessions of mIRC or even in the same session of mIRC...
The multi-server scripting explanation can be found in the help file, type /help $cid, but it will be too hard for you to understand at this point.
I can see from your example, that you want to relay text from network EFnet, channel #chat, to another network. Tell me which network and channel, and I'll cook it up for you.