Dude I feel your pain, 89 240 230k miles. Alright first suspect would be the AIV, more specifically the IAA which controls the idle of the car. The its located on the back of the plenum. Find the throttle, the plenum is the elongated portion behind it that has ECCS or something written on it. Anyway on the end of the plenum closest to the fire wall sits the IAA, don't know the acronym, see service manual. The IAA is the specific valve that regulates the idle. The IAA also has a valve that regulates the A/C and boosts the rpms when the compressor cycles. The AIV is attached to the plenum via 4 bolts and a hose. its easy to detach. My guess is that its dirty. I cleaned mine initially with WD40, dumb idea, although it is a good de-greaser, just make sure not to immediately put it back on and start the car, you will understand the mistake I made as in fact WD40 is flammable. Anyway, try this it might work. What was happening to me was I having issues idling and kept cranking till I would flood the engine, so the car is probably running rich, and not getting enough o2 to get a spark. My car would stall in traffic at times. The real ***** for me was that I cleaned it and still had issues, turned out the valve itself was bad even with a cleaning. I still had a idle issue and figured out that it was I had a bad engine temp sensor which also plays a role in the idle. Beyond that it wouldn't hurt to replace the fuel filter, check the rotor and dist cap, looks like you have new wires, or course hopefully your plugs are good as usually they aren't the problem. I just had a problem with the MAF, mass air flow sensor sp? and switched it out along with an injector. So, with the high mileage early 240s a lot of them have an idle problem. Alternatively, I would clean out the throttle body and plenum with injector cleaner, this also helped the idle a little bit. Don't bother with Auto parts stores hit the junkyards as the prices are ridiculous and not worth it. I'm actually running a '93 AIV on my 89, just had to buy a longer hose to connect them. Check similar year Stanzas they have a lot of interchangeable parts. I have an extra AIV I could give you as I noticed these parts missing even in junkyards. Also if you don't have a service manual, its huge like 1000 pages, GET ONE!! mine was $60 like 6 years ago, I think they're on EBAY for $10, WELL WORTH IT. You can actually run a diagnostic using the ECCS or ECU, basically the brain of the car. Sorry for the novel, but this should give you some help, or check this site for other problems
http://www.240sx.org/faq/