I feel your pain... We had the same toilet. After we replaced the water valve it still didn't work right and would allow a little water to keep flowing if you didn't make sure the foot pedal snapped back all the way. The valve/pedal mechanism is a flimsy cheap design. Then the ball valve wouldn't close all the way and allowed the tank to fill up.
After having the Thetford overflow twice, we replaced it with a Dometic 310. Way nicer toilet. I'd highly recommend doing the same. We paid $165 USD online including shipping and then sold the Aqua Magic on FB marketplace for a decent price so the upgrade didn't cost much. We had 3 people interested within a day! Night and day difference.
The last thing you want in any RV is a water leak and leaking toilets in some cases can even end up in a total loss.
FWIW, I installed a shutoff valve behind the toilet. Good for peering down into the tank when rinsing or if you want to make 100% sure the toilet won't overflow but still want all the faucets working.