I was having similar issues. I'm not sure what happened after I got my headgasket replaced, but when I got my car back, it was doing the funky idle thing. Have you done the idle search function yet? If not, it's pretty easy. Takes about 30 min to do. I think it goes like this:
Start the car and let it idle for 10 min
Then turn the AC on high for 10 min
Finally, turn on the defroster for 10 min
That didn't work for me. I ended up adjusting the injector settings and now my car idles just fine. I almost think the mechanic messed with my settings in the Power FC, or even possibly reset it. He claims he didn't, and I don't have any proof that he did. I did adjust the injector settings to match what a set of 740cc injectors would need. I'm not 100% positive I have 740cc injectors, but the part number on the one I pulled out is showing up as a 740cc in google. I do plan on getting my car remapped later on this year. I'll have them flow tested for sure before then.