Both are valid forms.
Then in came the King.
is found usually in storytelling contexts. Moving the preposition before the verb and the subject after the verb puts greater emphasis on preposition and verb, all for dramatic effect. Compare "Then down came the rain" and "Out came the sun":
The itsy bitsy spider climbed up the waterspout.
Down came the rain
and washed the spider out.
Out came the sun
and dried up all the rain
and the itsy bitsy spider climbed up the spout again.
The role of many prepositions is to define the unfolding of action in space-time. Moving the preposition to a position of greater prominence draws greater attention to the elemental physical aspect of the action. The rain is falling. The sun emerges from the clouds.
The inverted word order in the second sentence (Then came in the King) is an archaism found mainly in storytelling contexts. Nowadays we would add there:
Then tumbled in six acrobats.
Then there tumbled in six acrobats.
There tumbled in six acrobats.
Tumbled in six acrobats. not used
In the mode of #1:
In tumbled six acrobats.