There is no standard form, but a simple addendum (or stand alone agreement) can be made to the effect that in the event that the sale is not consummated, through no fault of the prospective buyer, the seller shall repay the cost of the repairs made by buyer  and buyer shall have a lien on the property to secure said repayment. You can draw it up in plain language yourself, or, better yet, any attorney--and you should have an attorney already, when buying a home--can draft if for you easily enough. As long as the seller  agrees to the basic terms, you should have no difficulty making this happen. Good luck on your home purchase.