I would check the iac. It could be sticking or failing. Here is a procedure I found on another site to check the iac. I have seen a bad iac cause this problem. But I have also seen other issues like vacuum leaks cause the issue
You can check the health of the valve by checking its resistance. When you disconnect the IAC valve, connect an ohmmeter to pins 2 and 3 of the valve. If you get a resistance value between 10-14 ohms, it indicates a functional IAC valve. Now, connect the ohmmeter to pins 1 and 2. If you don't get a resistance value between 10-14 ohms, this means, the IAC valve needs a replacement.