The word there has no meaning.
It is the same word we see in sentences like:
There is a fly in my soup.
In the sentence from the Wizard of Oz, the writer has used it so that the noun phrase "a beautiful princess, who was also a powerful sorceress" appears at the end of the sentence instead of the beginning.
This makes the sentence more interesting.
This is called a presentational construction.
The sentence means: A beautiful princess, who was also a powerful sorceress, lived here then.
The word then means at that time .
The word here means in this place .
ell.stackexchange.com/users/8084/Araucaria - Not here any more.
To add to @Araucaria's answer, it's important to note that this is a rather old-fashioned sentence construction and would not be used in spoken English, even when L Frank Baum wrote his books.
Using old-fashioned grammar makes it sound like an older fairytale though.
These days, the construction "there is a fly in my soup" is the normal way to describe something's presence, but any verb beyond "is/are/were/will be" is not normally used.
So we would say "there was a fly, swimming in my soup" (where "swimming in my soup" is a further description of the fly's presence), but not "there swam a fly in my soup".
When dealing with archaic grammar to help someone who doesn't have English as a first language, I think it's important to be clear about what a native English speaker today can read and understand, and what a native English speaker would actually say themselves.
ell.stackexchange.com/users/21770/Graham
The word "there" sometimes appears just to introduce a concept, rather than specifying a particular location, as in: Limerick rhymes: "There once was a girl from Nantucket..." Expressions of ultimate approval: "There will never be another ... like him." Presence or absence: "There are no more carrots."
Suggestion: "There's no better time to...
(e.g.
buy a house)
" General (non-specific) location:
" There you are!"
" There they go!"
(In both of these examples, the actual location is unimportant; the first means " At last I've found you, ", and the second means " You can see them now ", and their location is even continuously changing and their actual destination irrelevant and usually completely unknown ).
Most authors would avoid including both " here " and " there " in the same phrase, due to the obvious potential for ambiguity and confusion.
ell.stackexchange.com/users/42285/jaxter
There lived here then, away at the North, a beautiful princess, who was also a powerful sorceress.
This is an old-fashioned way of writing, trying (successfully) to portray the feeling of old fairy tales.
So what does it mean?
"then" is there to convey that the fact reported here
follows from something stated previously.
There will have been an introductory phrase.
We could replace it loosely by "so". "
So there lived here...
" "there lived" is much the same construction as "there was".
We could replace it by "somebody lived" - That gives us the exact meaning of the phrase:"So a beautiful princess lived here, away at the North, and she was also a powerful sorceress."
But that's boring.
The Brothers Grimm version has more style (even if it's hard to read).
ell.stackexchange.com/users/9436/RedSonja
The word 'then' in the emboldened phrase refers to some information that the reader or character in the story is already aware of; so saying 'then' refers to that information to continues the story.
That is my understanding of it.
I must also say, sentence constructions such as this are fairly archaic.
ell.stackexchange.com/users/31900/tom
There lived here then,  away at the North, a beautiful princess, who was also a powerful sorceress.   The sentence is cited from  The Wizard of Oz, page 37 .  What do the words in bold mean?  Thank you!
What does "there lived here then" mean?
ell.stackexchange.com
<meaning><meaning-in-context>
ell.stackexchange.com/questions/108879
ell.stackexchange.com/users/40245/Jasmine Kuo
This is called a  presentational  construction. The sentence means:  A beautiful princess, who was also a powerful sorceress, lived here then. The word  then  means  at that time.   The word  here  means  in this place. "There" is sometimes used to introduce a concept. In this sentence, it is a presentational construction and means "A beautiful princess, who was also a powerful sorceress, lived here then", in which "then" means "at that time" and "here" means "in this place". The grammar in this sentence makes it sound more old-fashioned, like a fairytale.
This is a presentational construction and means "A beautiful princess, who was also a powerful sorceress, lived here then", in which "then" means "at that time" and "here" means "in this place". "There" is sometimes used to introduce a concept. The grammar in this sentence makes it sound more old-fashioned, like a fairytale.