There is a simple float valve in my Bissel carpet cleaner that stops the unit from sucking water into the vacuum motor. It could work in a tank.
One assumption would be that all of the grey water piping enters the tank from a single inlet.
The ball hangs in a cage slightly bigger than the ball below the inlet. As the level of the tank rises for ANY reason the ball floating up would seat against the roof of the cage and the rubber seal that should be there. This would stop the flow of water into the tank from the grey piping.
Yes the water would back up into the shower if you were using the sink. The contamination should be minimal and you would not have raw sewage in the shower to deal with.
Just my $.02 worth