Ahh, yes, I remember this tripped me up as well! So from where you are in the first picture, you're going to want to go left, down, right, up, left, left and that should get you out of there.
Thanks for all the help! I'll be getting this up there ASAP.
Oh, and quick update: I am still here! I promise a new section of the guide will be up soon, I was just stuck grinding/EV training some pokemon for a short while.