I had a very similar problem with my 98 civic hb. what it actually turned out to be was the iac. a temporary fix is to take this completly off the intake manifold and clean it with carb cleaner ect and also make sure there isnt any excessive buildup preventing this things internals from spinning. anyways be careful taking it off because there are two coolent lines running through it and if the cars been running you will get burned.