To me, this dream is meant to show how Walter really feels about his life and how he wants to react to his life.
Right before this dream starts, Walter's wife is really harassing him. She is complaining about one thing and another. To Walter, this is the sort of thing that he gets all the time -- it is the sort of thing that makes his life miserable.
So what he is doing in this dream is reacting in a brave way to this kind of treatment. He is going to stand up and take it like a man. He can't stop bad stuff from happening to him, but he will meet it with dignity and bravery.
I think this section at the end is a euphemism for what we all think every now and then. I've heard people say things like, "Just kill me now!" I know that they are kidding and what they are trying to say is that they are overwhelmed with their life or frustrated or stressed.
I think Walter's wife has this impact on him. He can never seem to do the right thing and she is always nagging him. He probably has days he just wishes he was dead and this was over. So, the firing squad of rain drops was an appropriate day dream to move into that thought process. I also find rain to be a moment of depression, great stress, or great problem in a story. Although it's the end to us, I think Walter is just about to get a talking to.
Walter Mitty's final daydream in which he is standing before a firing squad seems to reveal a secret death wish and to show that he is a very unhappy man. He dislikes himself, dislikes his nagging wife, and dislikes the life he has to lead. He is living in depressing times because the world seems to be on the brink of another great war. He is too old to make any radical changes. In the first dream episode involving the hydroplane, the crewmen refer to Mitty as "the Old Man."
"The Old Man'll get us through," they said to one another. "The Old Man ain't afraid of Hell!"
Thurber never specifies Walter Mitty's age, but he seems to be at least in his late forties, if not in his early fifties. No doubt he has some kind of mid-level office job, like Erwin Martin in "The Catbird Seat." In another of Mitty's fantasies he is an daredevil pilot in World War I. In this episode he imagines the following dialogue:
"We only live once, Sergeant," said Mitty, with his faint, fleeting smile. "Or do we?"
His afterthought seems to suggest that Mitty feels he has never had a real life. He is currently living a life directed by his wife. This daydream in which Captain Mitty is going on a suicidal mission may also indicate a death wish.
When Mitty kills some time in a hotel lobby and picks up a copy of Liberty magazine, we get a clue to his age:
"Can Germany Conquer the World Through the Air?" Walter Mitty looked at the pictures of bombing planes and of ruined streets.
The Liberty article obviously refers to incidents in the late 1930s, but Mitty puts himself back into the first World War as an aviator. This may be Thurber's way of showing Mitty's age. He knows he would be too old to fly modern fighter planes. Chances are he never served in World War I, but only fantasizes about having been in it. Thurber himself was flatly rejected because of his extremely poor vision. He writes about this experience in one of his humor pieces titled "Draft Board Nights."
In the hydroplane episode and in the World War I episode, Mitty is risking his life. Appropriately, he is facing certain death before a firing squad at the end. The reader would be justified in assuming that Walter Mitty, while leading a "secret life," is also harboring a secret death wish.