No, it will not be valid to have such a loan “written off” as Zakaat. However, there is a valid procedure whereby you may have the loan paid back to you and also at the same time have the equivalent amount discharged as Zakaat. The procedure is as follows: After first ascertaining that, your debtor is, in actual fact, an eligible recipient of Zakaat, you could then give him the amount of money with the Niyyah (intention) of Zakaat. Once he takes possession of the money, you could request him to pay back the amount he owes you. By implementing this procedure, the loan will be paid off, and your Zakat will also be discharged from your shoulders.1