Do you mean something like this...

Code:
on 1:Snotice:*client connecting*: { 
  set %temp.nick $9
  .whois %temp.nick 
  .enable #iplogger  
}

#iplogger off
Raw 328:*: { 
  write IPlogger.txt %temp.nick $+ 's IP is $7 
  unset %temp.nick
  .disable #iplogger 
}
#iplogger end