if it's idling high and failing smog, the very first thing to look for is vacuum leaks..

the MAP sensor can't regulate fuel correctly if there are vacuum leaks, plain and simple.