$iif($target == $me,$nick,$target)

in query the $target is your own nick and you have to use $nick to get the real target