What's the relationship between snail movement and rain?
The movement of organisms towards water is termed hydrotaxis. 'Hydro-' refers to water and '-taxis' refers to movement. Hydrotaxis has been investigated in animals such as the nematode Caenorhabditis
elegans (Wang et al., 2016) and, closer to snails, the gastropod Littorina
littorea (Gendron, 1977). Animals may sense the water content of their surrounding environment and moisture content in the air to move where they are more comfortable.
Animals need specific amounts water in their bodies to allow effective metabolism. We can control our bodily water content by taking a drink but simpler animals aren't afforded that luxury so they need to move towards/away from water. Your snails likely moved because the water levels in their bodies dropped as they 'dried out' over the week. They could then have sensed a gradient in the moisture content of their surroundings and moved towards it. Mechanisms in animals' bodies can give animals responsive behaviour, as seen here. For instance, C. elegans uses its cGMP pathway, neurons and biochemistry to respond to water content with movement (Wang et al., 2016).
References

Wang et al. (2016). cGMP Signalling Mediates Water Sensation (Hydrosensation) and Hydrotaxis in Caenorhabditis elegans.

Gendron, R. P. (1977). Habitat selection and migratory
behavior of the intertidal gastropod Littorina
littorea. J. Anim. Ecol 46 79-92