Which one of these two tag questions is appropriate here? and why?
They used to be very cheerful people, weren't they?
or
They used to be very cheerful people, didn't they?
The latter is correct. It is more appropriate because that question tag is the most suitable for the context.
To make this clear, you can't write "be" auxiliary in the question tag if the main verb/auxiliary of a sentence is "do/did/have".
e.g.
Main verb: be used to
We weren't used to winning back in the day, were we?
Main verb: used to
We used to lean back in this chair, didn't we?
However, the main focus here is not on "linking verbs" in any way. You just used a bare-infinitive along with "used to".
In formal English the correct tag is "..., used they not?", but some people may consider this archaic.
An old-fashioned British colloquialism is "..., usedn't they?".
But otherwise it's "..., didn't they?" - since "used to" is past tense.