Why does my gas water heater's pilot light go out when I replace the outer door?
Thermal switches (depending on models) can be really tricky.  If yours is really causing the problem I would suggest replacing it.  However, before replacing the switch, ensure you have proper airflow into the combustion area. (Not much stacked around unit, any insulation properly installed, etc.)  This really sounds like more of an air flow issue.