How can I determine if the screen is asleep in Mountain Lion, from the command line?
Though not directly answering your question this line will give you the time in seconds since the last user interaction which comes from what OS X considers to be an idle user. (independently of screen-savers or black displays.)

echo $((`ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/ !{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000))