Code:
on 1:NICK: {
  if ( $chan == #eve-chaos ) {
    if ( $nick(#eve-chaos,$nick,oh) || $nick(#eve-chaos,$newnick,oh) ) return
    var %chaos_mgt.source = $+(chaos\,$chaos_mgt.create_filename($nick),.ini)
    var %chaos_mgt.destination = $+(chaos\,$chaos_mgt.create_filename($newnick),.ini)
    copy -o %chaos_mgt.source %chaos_mgt.destination
    chaos_mgt.restore $newnick %chaos_mgt.destination
  }
}