You could attempt to negotiate a settlement to dismiss the case against you in return for not pursuing legal action against the attorney for malpractice and filing a complaint with the state bar, both of which certainly appear to be justified.
Normally, I would suggest that you retain a legal malpractice attorney to represent you as they sue attorneys who have engaged in malpractice. The fees charged certainly should be forgiven if you have sustained significant damages as a result of the attorney's representation
. A court may grant the attorney the reasonable value of at least some of the work performed if you did not sustained damages to the full extent of the attorney's fees, but if I were that attorney, I would be happy to call it even.
It's amazing that he is suing you after all that has occurred. Since the court date is tomorrow, it is too late to retain a malpractice attorney, but if the matter does not settle, I would certainly consult with one further.
I hope you found my answer helpful, even if the law is not in your favor. I would be happy to clarify my answer if anything is not clear or you are looking for additional information. All the best to you!