You ask, what exactly is idle. For one- not moving your mouse. Programs that are supposed to tell the machine that they are supposed to be considered as "active programs" do so explicitly by using APIs (which I'm not aware of, but I know exist :P).
Take WMP as an example. While you're playing a music file, your system will NEVER sleep/hibernate. Only when music is stopped will it take in to account your hibernation idle time. BUT it will dim or turn off your display as set in your power saving settings.
I guess your program wasn't designed to take hibernation/sleep in to account which is why Windows 7 proceeded to hibernate.