Fixing Toyota Highlander AC/Heat Issue

My (ex)wife had a 2004 Toyota Highlander that was exhibiting some strange issues with the A/C and heat. In the summer while driving with the A/C on it would randomly just switch to heat and just as randomly switch back later. Sometimes bumps would trigger it or a sharp turn. Same would occur in the winter while using the heat. It would randomly switch to A/C and back. The problem was pretty annoying but I suspect fearing the possible cost to repair kept her from bringing it in for service. The issue seemed to get worse over time and with...