Your routine lies to me on a Win 7 machine when I ask it for the status of an HP 6127 networked printer (using an HP 990C driver as recommended), it reports "Ready" when 1) the printer is powered down and or 2) the printer is switched on but the network is disabled. The status reported in the Common dialog/ Devices and Printers dialog usually gets it right in the end but only after a time lag.
On an XP machine on the same network I get the same results for the networked HP 6127 but the status of an HP OfficeJet 6310 connected directly to the machine via a USB lead is reported correctly after a short time lag.