Basically, set up an mp_grid, and then use mp_grid_path. If it returns false, you've got no path. An alternate is an A* extension.
Sidenote: If you're using this method, you may as well use it for your actual pathfinding as well.
But yeah pathfinding a maze will require a bit of setup like this.