Hooking up a NEMA 6-30p heater to a 6-50r socket
Yes.  Your plan will absolutely work, and be safe.  Make sure you properly use flexible cable (likely SOOW) with the breaker box you put together, and consider strain relief where the cable exits the box. 

However, the cheaper route you mentioned, isn't as dangerous as you think.....

Consider any device you plug into a normal 15amp outlet.  Very often, the circuit, and breaker are 20amp, even when the outlet has a  15 amp style receptacle.  Say you're plugging in a cellphone charger.  It needs 0.1 amp.  Yet your circuit breaker exposes it to 200 times that!  Omg let's freak out and build a special subpanel at the outlet to provide a breaker appropriate for the cell phone charger.  Wait.  Nobody does that.

Plugging a 30 amp device into a 50 amp outlet is no worse than plugging a 0.1 amp device into a 15 amp outlet.  Just change the plug and be done with it.

But if you enjoy building sub panels, enjoy this project!  If you build a special sub panel just for this, you should consider adding 20 amp breakers and outlets to it also.  Could end up being super convenient to have.