The fairest way I think is to consider what the flat was worth when you moved out and stopped paying the mortgage and you would get 1/2 the equity that was + what that equity would have accrued in a savings account
The difference in value in the intervening 2 years is all your sisters
Eg
Flat cost £200,000
deposit £20,000. Mortgage 180,000
4 years later you moved out
flat valuation £250,000
mortgage £175,000
so equity is 75,000
your 1/2 should be £37500 + interest at what was the going rate at the time for the 2 years
If the flat when it was sold went up to £285000 and the mortgage went down to £170,000 with just your sister paying then the equity she would get would be £115,000 less your payment of £37500 + interest you would have accrued.
Estate agents fees should also have been split to reflect your half of the fees when you wanted to sell and your sister would cover the difference
Solicitors fees and any other fees 50/50
Whilst she did agree to pay the mortgage and bills whilst she was living there. I think that statement is quite open to coming after you for these payments when she wasn’t living there
I take it no decent solicitor was involved in drawing up this Contract because they would have seen the issues and put in extra clauses to cover all possibilities
If your sister is only coming after you for mortgage payments then I would pay as it could end up making you worse off if you try to fight it.