Plugging your truck in, even for an hour, could raise the coolant temp enough to be above the high idle threshold. I worked on a truck once that would sporadically idle like crap. The pins in the coolant temp sensor plug were wore the f out. It would read true coolant temp with the engine off, but once started, the vibration would wiggle the pins enough to cause a false reading. Even though the engine was at operating temperature, the pins would cause a false reading ( said it was 3 degrees) and that changed the timing/fueling and made it idle like chit. If you got a bad plug or sensor, if could be causing the ecm to think the engine is warmer than what it is and not enter high idle mode.