> If there were a clean LaTeX method (there probably is!)
> for achieving the effect without the need for \global hacks, then
> all would be well.

\begingroup
\uccode`\~`\"
\uppercase{\endgroup
\def~}{^{\prime\prime}}

I leave it to others to judge how clean this is:-)