This problem could happen if the ignition timing has been adjusted without first disabling the electronic spark advance system; or was set without using a timing light, or was not set to the manufacturer's specification. It is necessary to follow all of those procedures in order for the engine to operate properly. There may be instructions on the underhood emission label about how to disable the electronic spark advance. Otherwise; it will be necessary to search online for this information.
If the EGR vacuum solenoid has been bypassed or is not properly connected; this could also cause such a problem.
A clogged fuel filter could do this, too. So could a leaking PCV hose, or a leaking vacuum hose to the MAP sensor, or a leaking vacuum hose to the brake booster.
So could a damaged intake manifold gasket, a leaking throttle body gasket; or one that is leaking because the mating surfaces were not sufficiently cleaned; or is leaking because gasket sealer was not used on the gaskets.
Plug wires with excessive resistance will cause plugs to run in a borderline fouled condition; which will lead to idle speed instability. NGK plugs are far more prone to fouling than most other brands. I would use Autolite #5224 plugs at .045" gap, and either replace the plug wires or insure that each individual wire has less than 1,000 ohms resistance per inch of wire length.
If the valve clearances are out of adjustment; or there is more than 20psi compression difference between the lowest and highest cylinder pressures; or if the compression in any cylinder is below the minimum allowable factory limit; the motor will never idle consistently.