As has been discussed, IAC related items, IAC itself or a TPS can cause issues like this. Sometimes there's an A/C input that can offset the IAC value to compensate for compressor load but that's probably unlikely. A data log would help alot, I'd log the TPS, maybe IAC duty cycle or commanded position (depending on style), MAF or MAP depending if it's speed density or not. Any throttle switches (if there are any). Maybe even look at the coolant temp sensor and IAT, those being out of range can cause certain functions to kick in.