You know your approach is wrongheaded and dangerous. But that's also because it is not necessary.
We'll do my favorite trick: Permanent wiring methods temporarily. In other words, wire it up all Code legal like it'll be there for 50 years, and then 50 hours later, undo it.
It is perfectly legal to install an inlet on your home that powers any number of outlets in your home. It's also legal to use flexible cord for the inlet, if it's to be frequently unplugged.
Going into your heater socket is bad because there's a thermostat in the way. So instead, we'll go into the thermostat location. But hold that thought.
Rewiring the service panel
First, in the panel, we take some photos (this can be done well in advance), and identify the circuits we want on generator backup. We also identify the fat 10 AWG cable going to the heater. It'll have a black and white wire. We take the black wire, and join it to all the black wires from each of the circuits we need to power on generator.
Now here's the tricky part: we follow each circuit black wire, back to its cable, and identify the white wires also in that bundle. We pull those off the neutral bar, and join them to the white from the heater. Don't just leave them all on the neutral bar; pull them off. This is important, because the generator GFCI will trip if you don't.
If any of these cables have a red wire also, you need to figure out whether you need red or black, and connect that one to the black bundle. If the wire is 12 AWG, you can just connect both to the black bundle.
At this point, none of the wires for the heater circuit or desired circuits are on breakers or neutral bar anymore. They are nutted to each other, using the service panel as nothing but a splice box. This is Code legal.
The ground wires, leave them where they are.
At the thermostat
Now, back at the thermostat. Open up the thermostat, take photos of the existing wiring as-it-is. If you feel it'll help later, mark some wires with tape before taking the photos. Now, remove the thermostat, and store it.
Now, we need a heavy duty 12 AWG appliance extension cord. Oh hey, that suicide cord you already faked up needs to be destroyed anyway... so let's kill two birds with one stone. The 240V (NEMA 6-30) plug you added -- remove it. Get to black, white and bare.
Now, get an appropriate blank cover plate for the thermostat box. Except we need a cover plate with a knockout on it. We also need a proper strain relief for that cord; an electrical supply house will have no trouble setting you up if you bring in the cord. Install the cord in the blank cover plate, with the strain relief, and secure it.
Now, in the thermostat box, identify the cable that goes back to the service panel (not the one going to the heater). With those wires, splice cord bare to cable bare, cord white to cable white, and cord black to cable black.
Install the cover plate and screw it down. Now you have a flexible cord coming out where the thermostat had been, with a plug on the end. This is a code-legal inlet.
The use of a flexible cord is legal because this will be connected and disconnected frequently. As in, twice.
Once the crisis is over, rollback the wiring to the way you found it. Take the cable-with-cover-plate-on-the-end, and throw it in the emergency kit for next time.
The one Code problem here
Presuming the generator's circuit breaker trips at 20A, we may be connecting 14 AWG /15A circuits to a 20A breaker, which would violate NEC 240.4's statutory limit of 15A on #14. (thermally it's allowed 20A at 75C temp). However, the practical likelihood of overloading them is low, since you'll be powering several circuits off one 20A breaker, and it's unlikely for one 15A circuit to gobble up more than 75% of total available power.
Best Answer
There is one way you could do this without a panel replacement that would be safe - whether or not it would be "to code" I'll leave up to the peanut gallery. (who I am sure will not like this answer at all)
Tear out your 20A circuit and replace it with a 30A with a 30A receptacle. Not only replace the plug on the saw - but replace the entire CORD on the saw with a 30A cord and terminate the cord in a "motor controller switch" mounted on the saw that has properly rated overload heaters in it that are sized for the current draw of the motor at 240v (which is likely to be around 6-7 amps if it's a table saw like I'm thinking) Then run the regular cord from the motor controller/switch to the motor.
Building codes don't cover internal appliance wiring and of course the moment you modify the saw (by replacing the cord) you are no longer covered by UL or any of the other certifications and you are letting the manufacturer off the hook should the saw burn the place to the ground. But, it is "safe" (as safe as any saw can be - which isn't much) since the motor controller switch protection is no worse than a breaker (and probably better) And considering the number of tool manufacturers who have bit the dust over the last 2 decades there's a good chance your saws manufacturer isn't around to sue anyway even if you didn't modify it and it burned the place to the ground.
I have a shop full of older metal woodworking tools made in an era where the prevailing wisdom was something along the lines of "we don't need no steenking ground wires" and were all, in their day "to code" so I tend to take "code" with a bit of suspicion.