You could invert the hash so that the keys are the numbers and the values are array refs of your current keys.
For example, instead of this hash structure:
%hash = (
'foo' => 10,
'bar' => 30,
'baz' => 10,
);
You'd have:
%hash = (
10 => [ 'foo', 'baz' ],
30 => [ 'bar' ],
);
Then do a normal/typical sort on the keys.