I had a similar issue with buying a house. In the end we just wrote the roof replacement into the contingency of the contract and adjusted the price a bit so both sides paid a little bit into the cost of the new roof. The roof was replaced, we got our insurance, and the house was sold.