If the attaching creditor, after having redeemed the property, does not recover judgment, he may nevertheless hold the property until the debtor repays to him the amount or amounts which he paid for the redemption, or as much thereof as the debtor would have been obliged to pay to the mortgagee, pledgee, lienor or conditional vendor, or his assigns, or any of them, if the property had not been attached, with interest from the time when it was demanded of the debtor.
Mass. Gen. Laws ch. 223, § 78