Would connecting an ungrounded cable to a new grounded cable in a box violate code?
The junction box must remain accessible, but I've a hunch you know that, as a good sense of rules and practices seems evident. 

Yes, just ground the metal box.  I would use a #10 pigtail to the 10-32 ground screw hole on the box.  They sell adorable green screws for that purpose. 

The stove is grandfathered, so it continues to be legal without a ground.  I didn't say "safe".  As such, I strongly encourage you to ground the oven at this time.  No need to fish a 6/3+gnd cable on that impossible route, you only need to route a bare #10 ground wire via any route. It does not even need to reach this box or the panel.  It will suffice to reach anywhere with a #10 or larger ground wire back to the panel, or metal conduit to the panel, or anywhere on the grounding electrode system (the wires from the panel to your water pipe or ground rods). 

An equally effective (but $90) alternative is to fit a 2-pole GFCI breaker on the oven circuit, and jumper the oven as if it was grounded, i.e. Its internal neutral-ground jumper pulled. However, this method brings with it the chance of nuisance trips.