Fork me on GitHub

What helped me was to do as suggested in the question and make a visualization of the grid with \#. \. and \_. What worked for my data was to define \# as (>= (used node) 100). As suggested by @bhauman I made sure that when the wall was hit from below the only choice was to go left (have only one from position be created, rather than all surrounding from positions). @angusiguess: Your solution sounds like it will work and not require such an intimate knowledge of the structure of the grid. I'll test it out with my data now...