The speaker longs to be sober and to stand upright at a moment when life asks for nothing fancy, only what is plainly necessary. The opening "o" sounds like a sigh or a wish, so the poem begins in yearning rather than confidence. Being sober here could mean not drunk, but it also suggests being clear-headed and steady.
The surprise comes in the image of a gun. The speaker compares himself, or perhaps his own resolve, to "my own true gun," a "good piece of safety." A gun is usually about danger, yet this one is valued for protection and reliability. The last lines make the point: it has "never yet shot off." Its strength lies in being ready without being used.
The mood is quiet, determined, and a little wary. The word "yet" leaves a slight tension, as if restraint is something the speaker must keep choosing.