What is necessary to make my old 3-wire 30-A dryer connection compliant with current code?
NEMA 10-30 receptacles are grandfathered, illegal for new installation but legal to leave alone if already installed. It is not safe and it has a body count.  It is legal because of lobbying by the appliance industry.   

By modifying it you lose your grandfathering and make it illegal.

Your proposal solves the safety problem electrically, but mechanically it is not code legal.   I am reluctant to say it would be "safe" because generally, code is written in ash and blood, and they wouldn't outlaw a thing unless experience has shown it causes fire or fatality. 

Your best bet is to retrofit a NEMA 14-30 4-pin receptacle, and connect hot-hot-neutral to those same wires on the 14-30.  Connect ground as follows: 

Code (as of NEC 2014) allows you to retrofit just a ground wire, simply by running a solo ground wire.   It does not need to use the same route as the conductors.   It cannot simply go to the rod/pipe ground source that the panel uses.  It must go back to the panel, and the same panel as the conductors. 

The ground path must be the required wire size its entire run.  As long as that is true, multiple circuits (out of the same panel) can share a ground wire when retrofitting grounds.