That's a tough call. Good workers are hard to find and the moodiness and attitude may be related to his outside life.
You mentioned that he "snaps back". That somewhat suggests that perhaps your approach is a bit confrontational. Perhaps sometime when he is in a better state of mind gently ask him if something you do aggravates HIM?
"... I consider him the best and most valuable employee I've ever had. He produces and contributes greatly to the shop output."
Given that statement I'd seriously suggest trying to work with him, as a replacement might be more pleasant but less useful and productive, quality work is essential to business. What's more important, the social aspect or the work?
They are not good if they are toxic.