Bad grounds are notorious for causing electrical faults. It's always a good idea to go around the truck and disconnect each ground and clean them one at a time if you know it hasn't been done previously. When the truck idled up, did you hear a 'sucking' sound from the intake/throttle body? The disconnection from the ground circuit may have caused the IAC to open, bypassing the throttle body