going to the surface to get air to breath perhaps, or it is just a foraging behavior. It is faster to sink to the bottom and start up again than it might be to crawl down the glass. Defensive behavior, snails at the surface are more likely to get picked off by a predator, so it is to their advantage to sink quickly out of sight if they reach the waterline.
*shrug* as for what it really is, I dunno.
~~Colesea