As long as your contract has a contingency on them fixing the roof, you should be safe. Earnest money is refundable if the seller doesn't hold up their end of the deal. Take a look at the earnest money section and it should say that. Typically, that check will not be cashed until closing. At closing, it will be given back to you or $1,000 credit will be listed on the HUD on your side.