It returns user@host so you would then have to split at the @ character
set host [lindex [split [getchanhost $nick] @] 1]
You could then use a regexp to test if the host is numeric, if not use dnslookup to convert hostname into a numeric ip.
It's a little more difficult than that because you would have to code the event of a hostname that will not dns resolve.
This works for nicks in a bot channel. For any nick it becomes even more difficult. You would have to send a network /whois and interpret the raw numeric response.
The 378 numeric response is not a standardized numeric, and is conflicting across different irc networks. You would have to be very cautious to check that this numeric is supported in this manner for your irc network.