Thanks for your reply.
I would also say the option for a private Charge would be best for both parties.
I'm afraid you will both need to appoint a Solicitor each to deal with the paperwork and register the Charge at the Land Registry. The correct procedure would be to date the Charge on the same day as you give your friend the 50K, enabling his Solicitor to pay off the Mortgage and for your Solicitor to receive the signed Charge. Your Solicitor will then register the Charge at the Land Registry.
Having a Charge, then means as and when the property is sold, whatever is outstanding under it, will need to be repaid to you. It does therefore mean that you can not demand the return of your money until the property is indeed sold.
However, depending on what you agree with your friend, the Charge can stipulate that it is repayable after X years, as well catering for extra interest to be repaid to you, so you are not out of pocket. It all depends on what you and your friend are happy with.
I hope this helps and sets out the legal position.
Please let me know if you require any further clarification.