If only it were that simple. The deposit is almost always held in escrow. And whoever is holding it in escrow, can't just release it unless both parties agree to it. Depending on exactly what the contract says about the inspection contigency, the buyer could be within their contractual rights. Or it could be unclear. Also, the above approach could make sense in a hot market, or even a reasonable market, but now?
Also unstated is what the buyer has asked to be done about this, if anything. All we know is the home inspector flagged it. Usually, the contract would say that after the inspection, the buyer has X days to notify the seller in writing of any issues they want remedied.
If they have done that, then I would probably call in a licensed electrician and have them take a look, then write me a letter stating that the wiring in question is safe and meets NEC. Send a copy of that to the buyer, along with responses to any other issues.