There is a really good interest calculator on the internet (if you search for "Zinsen berechnen" you can find it, for example). I use it to calculate all possible scenarios. There is a mortgage calculator where you can calculate annuity loans, but there are also savings calculators. Actually, there are no wishes left unfulfilled, and it makes everything much easier to overview when you work with concrete numbers.
Keep in mind in your case (special repayments) that you can possibly only make a certain amount of special repayments per year with your annuity loan. Usually, it is about 5%, but there are also contracts with 10% (which usually costs an interest surcharge).
Tendentially, I would assume (but I cannot say for sure without concrete numbers) that staying with the building savings contract would make more sense. You, of course, have to consider the tax issue, someone already mentioned that. But when the building savings contract is fully paid up, it might be that they pay out the money completely, but you cannot repay everything immediately, only year by year.