> if I heat my house now with natural gas or oil, am I really doing the environment any favors by switching to electric where in some regions a very high percentage comes from coal (and natural gas and oil)?
Yes.
The precise details will vary by location, but for example this was a very common argument used against EVs, they're just coal powered cars! So the Union of Concerned Scientists did reports on exactly how bad an EV in specific locations would be, and even in highly coal dependant areas, it was still better, today, and would only get better as the grid gets greener.
https://blog.ucsusa.org/dave-reichmuth/are-electric-vehicles...
Lots of people seem unaware that heat pumps are about 4x the efficiency of even modern gas heaters, so just burning the gas in electricity generators would be enough for us to cut out all Russian imports and more.
You are right that insulation, and efficiency are important (e.g. it makes sense to insulate your house properly when planning a heat pump install, and the oldest and least efficient boilers should be targetted first for upgrade) that was part of my point, see the link to the Energy Saving Trust who have in depth details on exactly which things help the most and cost the least, and look up your local equivalent.