Compare
(A) "If Anna was here, she would've known what to do."
(B) "If Anna had been here, she would've known what to do."
In (A), the speakers are currently considering what to do and lamenting that Anna isn't with them right now, because she would have been able to help them.
In (B), the speakers are discussing a past situation (we don't know how recent) where Anna's absence left them with no solution. The opportunity to do the right thing has now passed.
I think if you see the difference between the two, that will go a long way to helping you with similar constructs.
"If you (wear) a beard all the time, they (not recognize) you without it."
All the below are possible:
(A) If you wore a beard all the time, they would not recognize you without it.
(B) If you had worn a beard all the time, they would not have recognized you without it.
(C) If you were to wear a beard all the time, they would not recognize you without it.
(A) Can be used in a past sense, in a kind of confirmatory way: Given that you always wore a beard, then of course they wouldn't recognise you without it. But it can also be a suggestion for the future: if>then.
(B) In the past period referred to, he wasn't in the habit of wearing a beard, and therefore had no chance to pass unrecognised by removing it.
(C) More specific than the second sense of (A). Making a hypothetical suggestion concerning a group of people currently unknown; implying that at the moment he doesn't wear a beard all the time (or at all).
Strictly speaking I think this is probably a duplicate of Past tense for indicating long distance (a somewhat misleading title, since the OP is actually asking about the significance of the verb tense in, for example, "What is/was your name?").
The answer is that in almost all contexts, the verb tense in OP's example sentence has nothing to do with Past/Present. Native speakers frequently use "I was wondering..." instead of "I wonder...", because the past tense metaphorically "distances" the speaker from the utterance - which has the net effect of being more deferential, hesitant, polite, formal.
Partly for the same reason, and partly just because it sounds more "consistent", we often describe "the thing wondered about" in the past tense as well. Hence...
1: "I was wondering what your name was"
usually means exactly the same as
2: "I wonder what your name is"
...but to most native speakers, #2 might often seem rather brusque, if not actually rude.
Best Answer
Fairy tales are often written in more informal and dramatic language, since they are meant to be read aloud to children.
In particular, mixing or shifting of tenses is a dramatic technique to draw the reader/listener into the action. See this Wikipedia article on "historical present".