1. 'Then' at the end of a sentence serves the same function as 'So' at the beginning or middle.
'I'm hungry.'
'So have something to eat.'
'I'm hungry.'
'Have something to eat, then.'
2. 'Though' at the end of a sentence serves the same function as 'But' at the beginning or middle.
I did the test, but I found it difficult.
I did the test. I found it difficult, though.
Both of these forms are very common is natural speech. If you listen to native speakers, you'll hear these words used a lot at the ends of sentences. And if you analyse what they're saying, you'll see that 'then' and 'though' just mean 'so' and 'but'.