I have no idea what ARcanUSNUMquam is on about LOL. I think hes gone down a different path from what your talking about.

But on looking at how /whois seems to work when echoing, im pretty sure that the whois reply if its set to reply to the active (alt-o/irc/show in active:whois) replies to the $wid when it is invoked, if that window still exists when the whois is returning data.

I tested this by several means , one by...

alias whois { echo -s Doing WHOIS current wid $wid, whois for $1- | whois $1- }
Typing...
//window -e @test
Followed by in @test window typing...
//echo -s @test wid is $wid | .timer 1 60 whois nick

Status window cam back with...
@test wid is 13
Doing WHOIS current wid 13, whois for nick
<whois nick data replied in the @test window>

I then advanced to typing in @find
//echo -s @test wid is $wid | .timer 1 60 whois nick
followed by
//window -c @test | window -e @test
followed by
//echo -s The new @test wid is $wid

Status window cam back with...
@test wid is 13
The new @test wid is 16
Doing WHOIS current wid 13, whois for nick
<whois nick data replied in the STATUS WINDOW>

I did another test where I had this raw
raw 319:*:{ window -c @test | window -e @test }
in @test i then typed /whois nick
Apon the raw going off no other data was displayed in @test, rather it appeared in STATUS WINDOW

OK so whats that all mean, little i guess, besides that maybe an alias something like this (simplified alias here to deal with only $1 but its an example only ok)
Code:
alias whois {
  var %itemname = $+($cid,@,$1)
  hadd -m whois.tracking.table %itemname $hget(whois.tracking.table,%itemname) $wid
  ;^ add $wid to hashtable itemname $cid@$1 (adds to cater for multiple whois's on same user)
  whois $1
}
;
;and with raw 318 $1- = $me nick End of /WHOIS list.
;
raw 318:*:{
  var %itemname = $+($cid,@,$2)
  var %itemdata = $hget(whois.tracking.table,%itemname) 
  var %wid = $gettok(%itemdata,1,32)
  if ($deltok(%itemdata,1,32)) {
    hadd -m whois.tracking.table %itemname $v1
  } | else {
    hdel whois.tracking.table %itemname
  }
  echo -t $window($+(@,%wid)) $3-
}


* this has been writen here so is untested, and of course doesnt have any error cheks for things like non existing wid windows etc, and doesnt cater for whois with multiple nicks, but i felt it was a starting point to acuartely tracking what window a whois came from.

All other raws of the whois could be caught and direct using the similar process, just not removing the hash table entry since it isnt finished with of course.

PS: i think im on the right track here, yell out if i have fallen over board or am driving towards rocks!