You are talking about 2different things here. Any home buyer is entitled to have a home inspection done and if the inspection reveals flaws that you are unwilling or unable to correct then you are entitled to back out of the contract. Bear in mind that in the case of a REO no repairs will be undertaken by the bank although it would be worth seeing through your lawyer if they would give credit for those repairs. ( I was in one yesterday that had an abandoned swimming pool in the back - that would be worth seeing if you could get credit - if not then walk away)
The question of the Cert of occupancy is a little different since this has to be obtained from the town. Some towns will give conditional certificates pending correction of issues but it would be in your interest to get it written into the sale contract that your purchase is conditional not only on the normal inspections but also the granting of a certificate by the town - again the house I saw yesterday could be a good example. It would be most important that you speak with the building department of the town in question to see how they handle Certs of occupancy for REO's BEFORE you commit.
In NJ you will pay around $400/$500 for a home inspection which will include Radon testing and Termite inspection (most important) A certificatl of occupancy will cost $50 to $100 and a somke dectector around $50 ( all that requires is smoke and CO2 detectors in the right places and a fire extinguisher in the kitchen - no big deal.
Home inspection can be done within 24 hours of engaging an inspector and the Cert of Occupancy may take a week or 2.