Before snakes evolved it is reasonable to imagine a snake-like lizard (think skink) exploring and wiggling across a water body or into the ground, to escape predation or in search of food. It has long been debated by scientists whether it was an aquatic or subtaranian habitat shift that eventually lead to complete legglessness.
Researchers (Yi et al. 2015) at the Universtiy of Edingburgh and the American Museum of Natural History have been analysing a fossil of Dinilysia patagonica. This is a long extinct snake or snake-like species that appears to share some important inner ear morphology with todays burrowing Squamates. The spherical vestibule is pronounced, within it the socullar otolith sits, which works by enhancing vibrations and thus increasing sensitivity seismic waves opposed to air born sound waves. Modern snakes have indeed lost the ability to pick up any air born sounds (arguably, will post).
Not all Squamates are burrowers but this correlation between the specific inner ear morphology of D. patagonica and those of todays burrowing Squamates, does suggest a deep evolutionary link. So the subtaranian theory holds a little more water.
Yi et al. 2015 is open access here