(a) When an interest in real property is conveyed by deed to a person on a trust which is unenforceable on account of the Statute of Frauds and the intended trustee or his successor in interest still holds title but refuses to carry out the trust on account of the Statute of Frauds, the intended trustee or his successor in interest, except to the extent that the successor in interest is a bona fide purchaser of a legal interest in the real property in question, shall be under a duty to convey the interest in real property to the settlor or his successor in interest. A court having jurisdiction may prescribe the conditions upon which the interest shall be conveyed to the settlor or his successor in interest.
(b) Where the intended trustee has transferred part or all of his interest and it has come into the hands of a bona fide purchaser, the intended trustee shall be liable to the settlor or his successor in interest for the value of the interest thus transferred at the time of its transfer, less such offsets as the court may deem equitable.