Step 4: Magnets!
Pop a shallow hole in the "X" brace the same diameter of your magnet. Slop some superglue in here, and hammer your magnet in. Let the glue dry and sand it down. Put a dab of ink on the magnet and close the brace down on top, which will mark where the magnet should go in the leg brace. Do the same drill-glue shenanigan on the leg brace. To get the magnet really in there, put a magnet on the jaw of the clamp and work it into the hole so it sits perfectly flush.
For the legs, I ran into a problem because the aluminum top is not magnetic. I bolted on a little steel piece for the magnets to interact with; you could do that part any number of ways depending on what your table top is made out of. Your legs should now stay retraced when you retract them.
Congrats! Bust open a couple of beers and check out your sweet new low folding table . . .