You're missing the location parameter for the ON NOTICE event.
Code:
on *:notice:*is registered and protected*:*:{ 


The two notices are used for different reasons.
The first one (as mentioned in this post) is the notice from nickserv telling you that the nick is registered and protected.
If you want to use the nick, you have to identify yourself as tnee owner of the nick, otherwise nickserv may (and probably will) change your nick after 20-60 seconds.

The second notice is nickserv's message confirming that the identification sent for the first notice was accepted.