Once you have the hostname and the display number, add 6000 to the display number and attempt to make a TCP connection to that port number. If the connection fails, X is not running.
If you have setup X-Windows insecurely (that is, let anyone connect to it - you didn't think that "xhost" is much of a security, do you?), you are right. Sane people start their X-Windows server in such a way it isn't listening to port 6000. Or any other port for that matter.
X-Windows works fine using Unix domain sockets as well. You just can't display an alien application from elsewhere. Which is a good thing. (Though I have no idea whether X-Windows servers on Windows (sic!) machines can do this).