Actually I think your friend will be okay. While the developers (and lenders) are heartless, if there is a valid hardship and the buyers no longer qualify then getting the deposit back should be a pretty seamless exercise. I do not believe you will need an attorney. I am assuming that in order to qualify for the loan, your friends wife’s income was most likely used. Now that this income is gone then there is most likely no way they can qualify for the loan.
Ask your friend to do the following. Do not sign anything that would mean you forfeit the deposit. If they do ask to sign a valid cancellation then make sure that the cancellation does indeed spell out that his deposit will be 100% refunded. Call the loan officer you have been working with and inform him/her of what has gone on with the his wife. Let him know that the income has been drastically reduced. Let him tell you that you no longer qualify. Ask him to call the sales officer and let that person know. Have him do that immediately. Then call the sales office and have another chat with the salesperson you have been dealing with. Firmly request that the escrow be cancelled AND you want your full deposit refunded. If they give you some slack let him/her know you will need to speak to someone at the corporate office. If that does not work then let them know you will be consulting with an attorney.
You can send him my email address if he needs help with the sales office. I know of a good real estate attorney but he should not need one.