Something else to consider that I don't see mentioned often in regards to the MSP. Coil Packs.
I was having this exact same problem, rapidly dropping idle almost to the point of stalling. Constant CEL's. This kept getting worse and worse over time and then the car started dying. Then I could barely get it to rev over 3000RPM without horrendous popping and sputtering, and then came the FLASHING CEL....
Anyway, I found a Miata owner on another forum who described all my symptoms to a T. He had the same thing with the Miata. Went thru all the usual checks and he finally replaced his coil packs. Bam! Problem gone.
So, I dropped about $80 on a new set of coil packs. Autozone seemed to have the best price. Problem is gone. The MSP idles now like it did when it was new, no more "surging" idle at stoplights.
check and see if the vacumn hose is connected to the bpv. if it still does the same thing, check and see that the bpv is put on the right way. the arrow on the side of the bpv should be pointing the intake. a buddy of mine had the same problem where the bpv was put on the wrong way and had the similar effect.
To update, the ecu figured things out for me, and also the battery died on me...only a year old battery and I drive the car every day so that was weird. I had the car jumped and then the idle killed it in the middle of nowhere so I had to have it towed, which sucked, but the car it BETTER now, not great but good.