I will disagree with many of the replies. As I understand it, you were being tailgated by a ordinary jerk. You had no reason to suspect that he intended to threaten you, because sometimes jerks follow you for awhile to intimidate you. Not unusual. Most jerks are blowhards. You went home. Maybe not the best choice, but that's what you did. Fine, I'm not criticizing that because it is not germane to the substance of your question. You didn't know he was waiting for you when you got back in the car.
Perhaps you could have retreated back home and perhaps not. I don't clearly understand from your account whether or not you had that option. If you did not, you did not.... and that's that.
Assuming you were stuck where you were and could not retreat, he comes on with the bat. You had what you had in terms of a weapon. No criticism from me there. You make do with what you have.
I believe that I would have let him bang the on car and windows, because perhaps he would have given up after a few blows, having made his jerk point. That is, if you were really stuck and could not retreat by putting the car in reverse. If you coulda, you probably shoulda. But let's just assume you couldn't. Either way, you found yourself where you found yourself and you didn't do anything "wrong" and in no way deserved what came.
Had a window been broken, I would then have feared for the safety of myself and my family and would have felt justified shooting him. Any reasonable person would agree that severe bodily harm was imminent. That would have been sufficient justification for me. I would not have waited any longer and there would have been no more "benefit of the doubt" for the jerk-turned-assailant. At some point, I say you simply need to stop thinking, make a decision on a course of action.... and then simply act. And I really believe that I would have shot him.
Your situation struck me because I was myself in a very similar situation before cell phones. Stuck in traffic in a busy city neighborhood. Could not go forward, could not go back. No retreat except for perhaps getting out of the car and trying to outrun him. Obvious drug head behind me who was pissed about something I must have done in traffic gets out of his car and starts banging hard on my drivers side window with a knife butt screaming "I'm gonna kill you, MF", etc. I remained calm. He kept amping up the threats and the pounding. When I saw him get out of the car, I had enough time to rack a round into the chamber. I stared straight ahead, avoiding eye contact. I said nothing and did not engage in any way. Had the pistol off safety under my right thigh holding it with my right hand. I didn't want him to see the gun. I really doubted that the window would hold. I decided then and there that if he broke the window, I would shoot him. Twice. I would not have waited for further justification or for the events to get worse. I can't believe how calm I was during.....but I was really freaked afterwards.
Like you, I couldn't believe that some jerk would go to this far over the top over nothing. It took me a few seconds to get past that and to face the threat for what it in fact was. And I also still can't believe how clear my thinking was and how quickly the decision came. Time slowed down to nothing. It really did. I have no regrets whatsoever of the course of action I chose, although I am really thankful I didn't have to shoot.
As it turned out, several people had stopped on the sidewalk and gathered during the spectacle. I believe the crowd amassing is what convinced him to give it up. Traffic started moving, and so did I.