Can you take a picture of the gap? Having a hard time imagining it.
One way to keep the lid secured to the bin is to use
binder clips. They'll pull the lip of the bin against the lid and will hold the lid down.
I use
luggage straps from Walmart to hold the lid down on my bins, but they're really big. If you're using a small container, you can try getting long strips of velcro from the sewing section. Wrap those around the container with the lid on so that it can't be pushed up, even if there is a gap (assuming I'm thinking of the right gap).
For a small snake, you could probably get away with using books or something heavy on top of the lid to hold it down. Just keep in mind that snakes are pretty strong and have all day to spend exploring and figuring out how to escape.
If these are good solutions for you, try posting a pic of your setup, I know someone will have an idea.