This script walks through a maze automatically. The script can be modified to solve a maze automatically. See the notes below for more information. To run the script, position the spite to the right of a vertical wall, and then run it. It uses a technique called wall follower, which is also called right-hand rule or right-hand on the wall. The basic idea is to walk through a maze while keeping your right hand on the wall. You may hit a number of dead ends, but in the end, you will reach the end.
This is a basic solution. I'm contributing it to the community in the hope others will improve it. For example, add logic to detect when the end of the maze is reached or when an opening in the outside wall is found. Or, make the solution tolerate walls that are not perfectly smooth, and corners that are exactly 90 degrees. If you draw another maze, be sure the edges are crisp (not shaded). The edge detection algorithm is pretty simple and does not tolerate edge colors that vary. I found it easier to draw mazes using paint and then import them. Because scratch does not offer a way to detect when the paths of two sprites intersect, the program relies on the walls being thicker than the step-size of the maze navigating sprite. I added a debug mechanism which will print the decisions the solution is making. See the debug module.