Sentences 1, 3, 4 use 'then' correctly (albeit that they are not very elegant.)
Sentence 2 uses 'then' as an adverb of consequence. As such, it doesn't make sense. If you removed the commas, it would be an adverb of time, as in the other sentences.
'Then' as an adverb of consequence - nothing to do with time:
"Well, if that's how you feel, then I won't go with you."
"The price rose from $100 to $200. This, then, was a rise of 100%.
"What does this sentence mean, then?"
Student or Learner