The flop in the flex head might not be curable. It depends on what the problem is. If it's just a matter of the ball and spring being frozen, then when they get unstuck the condition will improve. But, and I can't quite tell from the pic, are the teeth on the flex head worn? I have a ratchet like that that is floppy because the ball wore into the teeth over the years, so the ratchet flops as a consequence.
On the "guts" of the ratchet, are you tapping the drive end with something to help loosen the crud? Also, take a small punch or some other blunt object that is a bit small than the diameter of the ball and press it into its hole. This will help to work fluid behind the ball and into the cavity where the spring rests.
You can find rebuild kits for ratchets, depending on the model. Even kits that are no longer produced you can sometimes find on eBay. The teeth on yours ratcheting mechanism seem good, but it looks very very dirty.