This is a classic problem. I've seen metal mesh tops in various sizes at Petco sold for this purpose. They come with spring clips that grab the plastic moulding on the aquarium. They'll work IF you always remember to clip the clips when you lay the lid back on the tank. This is an improvement on the home made wire mesh with a brick on top lid that works until you forget to put the brick on, which always seems to happen eventually. And the first time you do, your snake will lift the lid, get away, and get killed by something. I generally don't trust myself to never forget to clip the clips (or put the brick on top) I've learned the hard way. I like tops that are more idiot-proof, so I generally stick to the sliding screen tops on glass reptile tanks. When the top isn't slid shut it is obvious, and when it is there's no chance for your animal to escape.
I've wondered about using that flexible magnetic vinyl along the edge of a screen and/or the tank to keep it mangnetically stuck down. You can get it at http://www.magnetking.com/#rubbersteel
I just look for used reptile terrariums with sliding screen tops cheap in the classifieds. Good luck