Three ways come to mind.
1.
Positions small sprites around the snails to act as detectors to know the shape of the walls around it. Then have the snail move forward or turn accordingly. May need logic for both directions.
2.
Put sprites every spot the snail should turn. And when the snail hits then it stops and turns.
Here's an example. Tweaking the positions will make it better and it's fairly intuitive to do new levels.
https://www.dropbox.com/s/4dfaxu2k27hm3 ... .capx?dl=1
For the other direction just use different sprites.
3.
Put sprites right on the spot the snail should turn, and use it as a path to follow. Will require more events but it can be reused for both directions.
There are other examples elsewhere on the forum if the links still work.