Mazda Repair: 97 Miata Misfire, vacuum leak, head gasket


Question
I have a 1997 Miata 1.8L 5-speed with about 109,000. I bought the car just over a year ago from a dealership and never had any problems with it until about four months ago when one thing after another kept going wrong. I replaced the radiator, water pump, timing belt and pulleys, spark plugs and wires, serpentine belt, and the air filter. Then it ran fine for a week before it wouldn't start and I had to replace the battery and alternator. Ran fine for a week and I blew the head gasket. So now after having that fixed for about a month my check engine light came on while driving and began flashing. I checked the spark plugs and wires, both are fine, and I replaced the ignition coil pack all to no avail. The car runs fine except while idling the needle jumps around (+/- 100rpm) and some days I'll start it and it idles ~1200 rpm while other days its ~800. I'm not real sure what the next step to diagnose this is, please help!

Answer
if the engine light is on you can have it diagnosed and the coded read for you and get a general idea from there the an be so many reasons for an idle problem. vaccum leak, iac valve fauty, tps faulty, and thats just a couple the best bet is to get the codes so you have a starting point. start with the small stuff air filter fuel filter check for cracks in the intake and look and listen for  vacuum leak.