This surprises me about Virginia. I get that rules vary from state to state, but I thought one of common rules from state to state was that the act of threatening someone with a firearm is considered a deadly force attack. You aren't required to put your faith in the generosity of the BG that just threatened you with a gun. In that way the "No one points a gun at me and gets away with it" slogan might have some validity. It's not about defending property. It's about defending yourself or a third party from a deadly force threat with a firearm.
I also think it's odd Virginia would required you to inspect the BG's weapon to verify it's actually a real weapon and not a CO2 gun or a toy replica with the red tip cut off.
I'm not advocating running in to a stop-n-rob like the Lone Ranger, but it would seem like if a BG comes in displaying a pistol, you have no way to divine his intent, so you have a legitimate self defense interest.
In VA, unless things have changed in the last 7 years since I left, if you shoot someone in VA in self defense, it is still an affirmative defense. That means unless the circumstances are very obvious up front, you can expect to be arrested and charged with second degree murder, and then have to apply an affirmative defense to justify the shooting. This is where you can end up arrested and spending five figures on a legal defense for a justifiable shoot. It just depends on the the whims and political agenda of the officer(s) and prosecutor involved.
----
In the shooter's favor, the crime of robbery requires violence or intimidation. Therefore, in most cases using deadly force in self defense to a robbery will be justified. If the assailant used a knife or gun in the robbery, the use of deadly force will likely be justified, presuming the other elements of the defense are met.
Reasonableness is a key element that must be met. The reasonableness that the use of force is justified is assessed, at least theoretically, from the subjective viewpoint of the defendant at the time he acted.
Consequently, a person is justified in using force to repel an unlawful, imminent attack if he or she holds the subjective belief that the force is necessary. That's true even if it is a mistake of fact shooting, where it later turns out that his or her belief was wrong, provided that his belief was reasonable.
Theoretically, even if all of the robbers had pellet guns, the shoot would still be justified if a reasonable person would have believed they were actual firearms.
But, as noted above, if you get the wrong officer/department in a jurisdiction where an anti-gun mayor wants to make an example, you can be arrested and charged. In those same jurisdictions it's also not uncommon for the state's attorney to prosecute, rather than be viewed as soft on crime or pro-gun. Your options then are a plea bargain or what will still likely be a felony with some jail time, or spending a lot of money for a drawn out legal defense taking it to trial.
Put that same shoot in Arlington or Alexandria and the law enforcement response and the ultimate legal outcome may have been significantly different.