I should've thought of this much sooner, really...
Making a script accurately determine whether Link can move in a particular direction is kind of a pain in the ass. The game already has to figure that out all the time, though, so surely some standard functions could be made available?