In this sense, used to is used for the habit for past which is left now ...
He used to smoke ... (then he left)
while would is used for that habit the end of which is unknown as to whether the person left that habit or no ...
He would smoke ... (unknow whether he left that or not)
Khursheed Ahmad Khan
We "used to+ infinitive" (contracted to īd in spoken English) to talk about past repeated actions or when we talk about permanent situations that are usually no longer true, for example :
He used to work for police force. (but he doesnīt now)
And "would" is unusual in the negativ form or in Yes/No questions, we donīt use "would" with state verbs.