It's always recommended to put the code in mIRC remote exactly as it's shown here, and not in one line, to avoid syntax errors.
As for the script itself, what I gave you messages the bot - $nick - only when it joins the channel - not when someone else does. the '*' stands for userlevel, which currently is none, so I use *.
type /help on JOIN for more info.