Your current plan is no good for two reasons. First, you can't put a 30A receptacle on a 40A branch circuit as per 210.21(B)(3). Then, even if you wired up your dryer to a 50A plug and plugged it into a 50A receptacle, it'd still be against code as 210.23(C) prohibits non-cooking appliances on 40/50A circuits in dwelling units.
(Costs assume you already have the 8AWG wire and the 240V/1kW heater budgeted for, as well as misc parts such as j-boxes, wirenuts, etal. "Wire" is assumed to be 12/2 W/G NM-B -- that's $25 for 50' through the orange borg.)
Your options are as follows:
Use a 120V/1kW heater on a 20A circuit and get only one tandem breaker (if your panel will let you)
Cost: $125 for breaker + wire + heater
You'll need a QOT2020 breaker replacing an existing QO120 in your panel (or you can use a QOT1520 to replace a QO115, instead), as well as 12/2 wire (not hard) and a suitable heater, such as this Cadet unit from the orange borg. Pay attention to the labeling and design of your panel, though -- many QO panels reject tandem breakers altogether, and those that don't often limit the number of slots that accept them (to avoid violating the old 42 circuit rule from the NEC).
Use a quadruplex (sort-of...) breaker to split up the existing dryer slots to make room for the new 240V circuit (again, if your panel will let you)
Cost: $100 for the weirdo breaker + $25 for wire
There is a 30/20A quadruplex-ish breaker available for the QO line -- it's the QO20303020. However, you'll have to have a supply house custom order the kit for you or order it online yourself (it's 2 tandem breakers and a handle tie), and again, it may not be within the UL listing of your panel as not all QO panels are listed to accept tandems, and those that are often can only accept them in certain breaker positions.
Install a small subpanel somewhere -- this always works
Cost: $30 or $45 for breakers, $25 for wire, $25 for subpanel, and lots more work
You'll need at least two breakers for this, namely a QO240 and a QO215. Replacing the existing QO230 is another $15, albeit not really necessary -- QOs are reliable as far as circuit breaker reliability goes. The subpanel will be a QO612L100 -- get a F suffix if you want a flushmount, S (linked) if you want surface mount, DF or DS if you want the above but with a door.
This requires you to pull the existing QO230 out of the main panel and install a QO240 in its place, run the 8AWG you have planned from the main to the sub, install the subpanel with the 8AWG hots to the main lugs and the 8AWG ground to the ground bar main lug -- you will not be pulling the bonding screw out of this sub as you'll be using wirenuts for the neutral connection instead.
The 12AWG (or 14AWG if you'd prefer) wire for the heater goes to the two hots on the QO215 (tape or paint the white wire black here to mark it as a hot), and its ground also goes to the ground bar. Finally, the two hots on the existing 10(?)AWG to the dryer that is rerouted to meet the subpanel go to the two hots on the QO230 of course, the ground from that to the ground bar, and the neutral from the dryer goes into a wirenut with the incoming neutral (nobody says you can't make the neutral and ground connections in a panel in some other way -- the bars are just there because they're convenient).