If you need to close many windows quickly and they are spam windows (I assume that means they are query windows), you can shift-click each window to close them. Then there isn't any change of focus at all. Quick and easy... even with a LOT of spammed windows. Since windows usually appear at the end of the network's list of windows, you can start with the first one, leave the mouse in the same spot, and just keep shift-clicking until all are gone. You can close a hundred like this in under 10 seconds easily.
What do you need to automate for nickserv? There are scripts out there to handle nickserv operations, btw. If you want it to automatically identify you each time you connect, that's a simple command placed in Perform (or done with a script). More information of what you need would help.
If you change your nick on one network and then click on the tab for the other network, that nick won't be changed. If you then click on the first network's tab again, it should still be what you changed it to. If it is changing it back, check to make sure you don't have any scripts running that try to maintain your nick. I thought you could keep different nicks on different networks just by changing them (even though they don't appear that way in mIRC's options), but I guess that's a feature of Invision. You could put a variable in a script for each network that stores your password, then the script does a /nick whenever you connect and uses that nick's variable as your nick.