First: congratulations on your save. If you can keep cool the next time this happens, if you step toward the plane at the bottom of each loop that'll slacken the lines a bit and make the turn more shallow. Then step away at the top of the loop, which will make the turn sharper. The end result will be an airplane that at least doesn't hit the ground with the engine running.
Second, try to balance inside and outside maneuvers if you can. You can twist the lines up quite a bit, but long before you break them, the friction between the lines will make the plane hard to control.
Third, don't try doing it by counting. Walk up to the plane, pick up the lines, and walk back to the handle to untwist. This will ensure that you're really untwisting. When you're beginning, stick a finger through the lines to be extra sure. Not only does this make sure that the lines are untwisted, but you've just run the entire length of lines through your hands and had a chance to feel how bad the kinks are.
Note that if you have a frayed line you may get stuck by loose wire. I can assure you that this hurts -- I've been known to emit bad words when I do this. But better getting stuck by a frayed line than crashing a plane, at least in my opinion.
As an extra measure of untwisting, every five or ten times you hook the plane up, run the lines out as I just described with the far end completely free. That way, if each line has developed its own twist, you'll get that out. Because I'm really bad at remembering something like that if I only do it every once in a while, I do it every time I run my lines out.
Finally, it makes for an awkward takeoff, but if you hold the handle over your head and put a bit of tension on it, you can hold your lines clear of grass, weeds, and whatnot. That'll keep it from catching on things in the first place. (And always, if you can, mow the grass short -- if you're not flying on your own property you can't always get permission to do this, but if you can, do it).