Snails have a different nervous system than humans and other animals do so the snails do not feel pain like humans and other animals do.
However when the snail is boiled they can feel something such as irritation but it's not full on pain like humans feel so if you boil a snail it won't experience pain like a human or other animal would if boiled alive.
The same goes for Lobsters when you boil them alive as they probably feel scared when boiled alive but they don't feel a burning pain.
If the Lobster or Snail felt pain when boiled they would likely really fight the boiling especially the lobster.
I've boiled lobsters before and they never made a sound but did try to move around.