supplying 240V power to a hardwired heater -OR- a 240V receptacle
Simplest option would be to change the heater input to cord&amp;plug, and put the receptacle required on the wall, and plug in one, or the other.
For a fair amount of money as switches go, you can get a 30A rated DPDT (douple pole double throw) center-off switch that does what you ask. The one I could find was in the &quot;very beefy standard switch&quot; look and may be similar to what you have (Presumably DPST) if it's properly rated for the load. The one I found was rated for motor load disconnect use.
You may also be able to find that function in a &quot;gray box on the wall with a big handle&quot; format, but I struck out (I found plenty of disconnect switches, which are single-throw and don't do what you need.)
If you want to completely overcomplicate it (but it might actually cost less) there is the &quot;use a contactor relay&quot; method mentioned in comments. It strikes me as overcomplicated, and it might also be code-dubious as you'd be assembling a system from recognized parts (we hope - beware of Amazon, etc. for this sort of product,) rather than using a directly listed product.