I am not convinced that the fairytale world exists right now as a place that they can go back to. I think that could happen in another season, but who knows. It is possible i guess if Wonderland is a third realm that is not the real world and not the fairytale world. Though i still like the idea that it “Wonderland” is the real world though i think it is unlikely because they have cast a Red Queen and a Caterpillar unless they are in the fairytale world.
I thought at first that maybe the hat would allow him to leave town especially since we know he has mapped the area meaning as far as he can go to the boundaries. That made me think he has been trying to leave town.