Definitely check the intake manifold gasket. You can see a thin piece of metal (the gasket) between the intake manifold and the heads/engine. If it is wavy like cooked bacon, it is probably leaking and it will play hell with your idle. 97 GTS models are notorious.
I have had idle hunting/hanging problems and many suspected the idle motor. Some have even put a smaller inner diameter obstruction in the hose that runs into it (they actually used a socket from a socket wrench) and acheived some relief - - but I do not think it was permanent. Henessey discovered this fix, but again I do not think it was a permanent solution.
In my case, the first time it was the gasket. The second, the symptom went away after the computer was reset and appeared to be related to my Roe VEC gizmo voltage output to the TPS or Idle motor or something. My tech traced the varying voltage readings to the VEC. A reset of the car's computer and resetting of the VEC did the trick - - so far. FYI, my gasket was also getting wavy again but they checked it for leakage and found none. Probably just a matter of time until it does it again.
Sean Roe suggested that it could be fuel filter related. I have never replaced mine (22,000 miles; 4 year old car) so I probably will next time.