Or identify on connect,
On *:connect:{
if $network == DALnet { identify nick pass }
if $network == Undernet { msg x@channels.undernet.org login user pass }
...
}
But -- be careful with putting passwords in your scripts, because you can accidently reveal them to someone else. Instead of writing the plain password, you may want to $read() them from a separate file, so that in case you send the script to a friend he won't see the actual password.