My car does the same thing (usually only on highway) light comes on for 10-30 sec. then dissapears for a while (20 mins) and then re-appears. I am getting a 172 (rear o2 sensor not switching - lean) code.
I was also getting a 332 (EGR not opening) and 176 (front o2 sensor). This turned out to be a simple 1-hour procedure of cleaning out the EGR ports where they enter the upper intake manifold (behind throttle body) - they were plugged solid!
Check out GeoPappas FAQ on how to clean this:
http://www.contour.org/ubbthreads/showflat.php?Cat=&Board=trouble&Number=10673&page=0&view=collapsed&sb=5&o=7&fpart=1