Hello & Welcome,
It sounds like you could have a problem with the Idle Air Control (IAC) valve, which is used to control the idle speed on that engine. Or it could be that the throttle body area around it has some carbon buildup.
When you replaced the other parts around the throttle body, did you give that area a real good cleaning with throttle body cleaner? I ask this because having the wrong amount of air going through that area could cause both problems you mentioned.
I would also check the connector pins to the IAC and make sure they are clean. A poor connection can do all kinds of strange things.
I hope this helps. Please let me know what you find.
Take Care, Greg A.