Turn A/C on to see if it makes a diff, as ECM should adjust idle higher when A/C is on.
Another possibility is engine temp sensor, would be nice if you can watch live data and see what ECM sees for various sensor data if you have a scan tool.
Did you try to turn on A/C when it's about to stall/die? It should adjust idle higher when A/C is turned on. If it doesn't do anything your IAC is suspect.
TPS (a potentiometer) definitely a possibility. As suggested already, if you can watch the live data of sensors, it would help you to narrow the search.