If it's hot enough that it could get to the point that I'm going to run out of ammo, it is also highly likely that before that happens someone will get lucky and be putting a round through my shooting port at the same time I'm trying to put one out. Light's out. End of story. So much of real world combat is just plain luck.
Also, If I am up against an opponent serious enough to wear out my ammo supply, they'll probably start dropping mortar rounds or 40mm grenades on me before I go to the second case.
Seriously folks, your SHTF scenarios are straight out of Mad Max. One guy, or even a determined family cannot go up against the government grade opponents that you all seem to be envisioning. Sooner or later, the attackers under those circumstances, will just plain out-resource you and then it's over. Either they will opt for a strategy of containment, laying back on the firepower and putting you under 24 hour surveillance and waiting for you to get hungry, cold or sick; or they will land on you with both feet, hitting you so hard, from so many directions that you cannot effectively defend. At best you can make 'em pay for it, but... it's pretty much a foregone conclusion if the government comes after you.
Gangs of roving marauders will be eaten up by determined village/town defense forces or they will stay away from the towns and go after those stupid enough to think they can make it on their own.