Mleh, it's alot easier to have a sorted open list, and to not add walls to it in the first place. Because even if you come across a dead-end, the script will just jump to the next best tile without missing a beat.
*to self* Hey, my script is atleast twice aslong as any of the other ones! crappers...