It would probably be more worthwhile for 20 years if the working price is reasonable. With 20 years, you pay only about €1,500 more in total, but you get 10 more years of service. The 10 years are mandatory, if I read that correctly. For the saved €1,500, you don’t get a heat pump installed. In the end, everything depends a lot on the working price. With a heat pump with a COP of 5 (which will certainly be achievable in 10 years) and an electricity price of 30 cents, it is just under 6 cents. Whether electricity will become cheaper in the future with renewables can only be predicted by a crystal ball. But if district heating is also around 6–8 cents, it is probably cheaper in the long run.
Edit: Additionally, the lifetime of a heat pump is given as around 20 years. If you pay about €10,000 for it, 10 years of heating cost €5,000 fixed costs in that case. Even if it lasts 30 years, that is just under €3,000. Purely economically, €1,500 for 10 years is therefore a good deal.