So, you engaged an attorney for defense of an active piece of litigation against you and the attorney prepared a substantive motion, an ex parte request, defended against two opposing party ex parte requests, and made three appearances in court, in addition to all of the document and evidence review necessary to understand the case well enough to know what positions to take on the various issues and motions? That is not per se out of line, depending on the complexity of the issues addressed by the various motions and court arguments.
My responses to questions on Avvo are never intended as legal advice and must not be relied upon as legal advice. I give legal advice only in the course of an attorney-client relationship. Exchange of information through Avvo's Questions forum does not establish an attorney-client relationship with me. That relationship is established only by individual consultation and execution of a written agreement for legal services.
Defamation is an extremely complex area of law, and, quite honestly, takes a lot of time to litigate a case properly - I have handled many cases in this and related areas over the years. Your attorney's bill of $20,000 is extremely reasonable. For drafting multiple motions and making multiple arguments in Court on your behalf, he likely spent 125 - 175 hours of time. That would be $34,375 - $48,125 at my rate.
This answer is not a substitute for professional legal advice. This answer does not create an attorney-client relationship, nor is it a solicitation to offer legal advice. If you ignore this warning and convey confidential information in a private message or comment, there is no duty to keep that information confidential or forego representation adverse to your interests. Seek the advice of a licensed attorney in the appropriate jurisdiction before taking any action that may affect your rights. If you believe you have a claim against someone, consult an attorney immediately, otherwise there is a risk that the time allotted to bring your claim may expire.
It sounds like the attorney did a lot of work. It may not have been entirely successful, but he still did the work. I can't comment on the amount, but as a client, you are always free to negotiate your bill with your attorney. If you don't do that, and don't pay the bill, you will probably end up losing this attorney and being sued by him, will need to find a new attorney who you will have to pay to get him up to speed, and may not get any better results.
Talk to your attorney about your concerns and try and work something out.
Otherwise, get ready for more litigation and dealing with more attorneys.