idle speed or the fuel filter is clogged and pump is old , could be a wiring issue , here-- pull engine--install a sr-14 with a turbo x2 and 5-speed-/w/ nissan 350-front brakes ,rollcage,full flow 3"pipe , heat wrapped tubes& down pipe --put your mind to work for 600-H.P. out of a 4-cylinder 2000-lb car and go drifting.
search for a vacuum leak. on an efi engine, the unmetered air will be picked up on by the o2 sensor and more fuel added but then it becomes too rich so it drops back to the book, giving you a surging idle.
Every car has to run on gas unless hybrid
Install a new idle speed sensor.
I have a 1991 Nissan 240SX and the engine is KA24DE. Car won't start up without giving it gas and I have to hold the gas for a while to let the car run at normal idle. Once it's running and idling, it idles fine at 750RPM. When the car is driven for a good hour or two, the idle will start to go up and down from 350-600 once warmed up. The engine will also smell of gasoline when starting up the engine. Check engine light is on also. I checked the spark plugs while it was running and took them out one by one and they are all fine. Spark plugs look fine also. I am thinking it is the MAF, IACV, or throttle body but I am not sure. Check engine light is also on.