Before I give my theory on who The Stranger is, I need to preface that I don’t remember ever hearing for certain that it was ever stated that the Storybook storyline ever really happened. My theory, as unpopular as it seem is based on the fact that the writers of Once also wrote Lost.
My theory is that the Storybook story line is just that, a story. The Stranger is the author of the storybook and he came to Storybrook to base the characters of the stories on the citizens of the town. I’m still working out how the storybook came to being before The Stranger wrote it, but when he opened the box that had the book in it, his reaction could have been on of confusion or disbelief that the book he is the process of writing is already there.
I’m sure there are tons of holes in this theory, but I would love to hear your opinion on it.