I'm not sure of exactly what you need the text file to look like, but you can try this:
Code:
on *:JOIN:#chat:nicktrack $nick
on *:NICK:nicktrack $newnick
;
alias nickfile return nicks.txt
alias nicktrack {
  var %nick = $1
  var %readaddr = $iif($read($nickfile,w,$address $+ *),$v1)
  ;
  if (%readaddr) {
    write -dl $+ $readn $nickfile
    [color:red]; *** Found a matching address ***[/color]
    ;
    [color:blue]; *** Your special cases here:
    if (genius* iswm %nick) .notice $me Address Match for nick: %nick
    elseif (word2* iswm %nick) .notice $me Address match for nick: %nick[/color]
  }
  else {
    [color:red]; *** Did not find matching address ***[/color]
    %readaddr = $address
  }
  ;
  if (*, $+ %nick * !iswm %readaddr) {
    [color:red]; *** Found matching nick in list ***[/color]
    %readaddr = %readaddr $+ , $+ %nick $right($ctime,-2)
  }
  else {
    [color:red]; *** Did not find matching nick in list ***[/color]
  }
  write $nickfile %readaddr
} 


Since onNICK and onJOIN events have different nickname identifiers, the nickname is stored in a variable called %nick

You can add any echo's or notices as necessary in place of the red text

You seemed to have special cases in your original code. They can be added in place of the blue text.