Try this, change blue stuff to the real info, you'll need to make the *identified* should be a wildcard match for the notice you get when your passwd is accepted.
Code:
on *:connect:{
  if $network == [color:blue]NameoftheNET[/color] { 
    nickserv identify [color:blue]passwd[/color] 
  } 
}

on *:notice:[color:red]*identified*[/color]:*:{
  join #chan,#chanel5 
}