Dear Dave!
Great you posted this. In the meanwhile I was actually adjusting the previous solution to my real data and found out that ikegami's solution indeed 'only' fits my example, which I made up to convey what I am after. But not not my real data! Because yes, it ignores multiple occurrences of values. And it would sort and shuffle around not only the keys (which is what I need), but also the values (which is undesired). I was just about to prepare a post to explain what does, and what doesn't work.
But thanks to you both! That was great help!
Cheers,
Rober