Hiya! Check out pg.7!
When situations like this pop up, use the priority map.
You're 0. If east isn't an option cause you're at the edge of the map, you'll check space 2, then 3, etc until a space is open for what you're doing.
Hope this helps! If you have more questions, I can answer them a bit quicker on the discord. (Link on hinokodo.com)