Code:
on *:connect:{
if $me == $anick {
.ns ghost $mnick <password>
.timer 1 5 { .nick $mnick | .ns identify $me <password> }
;note on some nickservs there is no need to identify for the new nick if that is the same nick that was ghosted