Yes, you open a new window via the menu or if you use the /server command to connect then you use server -m (see /help /server).

As for the other command... You are probably using Perform here, right?
An on NOTICE script needs to go in Remote script, found via Alt+R or under Tools > Scripts Editor...
You probably need to change the code you have to:

on !1:NOTICE:*Password accepted - you are now recognized*:*: if ($network == NETWORK) .msg ChannelBot invite 123456

I changed # to * since it's probably not a channel notice and I included a check to only send the command on a specific network, since you won't want to do it on all networks where NickServ asks you to identify. You'll need to replace NETWORK with whatever the value for $network is on that specific network. Type //echo -a $network to see the correct value for your network.