Your missing a closing bracket and you should be combining your if's and you need to make sure a variable exists before using it when it isnt optional.
Brackets are off and you should combine if's when possible and use * instead of level 1 in the on text.
on *:nick:{
if ($nick == $me) && (Guest isin $newnick) {
nick %mainnick
.timer 1 3 Msg Nickserv identify %password
}
}
You need an On *:Load:{} with $inputs to set the two variables you use and possibly even another addition to the IF to make sure they exist before using them.