You may have already explored this option, but couldn't you make an alias?

if ($isquery($me)) command
else command

alias isquery {
if ($query($1)) return $true
return $false
}