Here's the revised text in PDF format - the paragraph numbers were a fluke caused by going from one word processor to another - strikethrough is deleted, double-underlined is added text. I suggest downloading it rather than opening it within a browser for better resolution:
Proposed Castle Doctrine Legislation - original draft
December 28, 2011 Revision
December 30, 2011 Revision
January 5, 2012 Revision
The answer to the question is "sorta". Qualified immunity is a judicial doctrine cooked up to let cops off the hook in civil actions under 18 U.S.C. section 1983 (violation of civil rights under color of state authority). But it's really a form of what we'd call a summary judgment motion, in a Virginia state court. Anyone can do a summary judgment motion already in any criminal or civil action, though 1) no one ever does it in a criminal action; and 2) there isn't any defined basis called "qualified immunity". But self defense or any other affirmative defense can be raised in a summary judgment motion or a plea in bar. The application of the "qualified immunity" idea adopted from 42 USC section 1983 litigation standards makes sense, because a defendant in either civil or criminal action could file a motion for summary judgment (or a "plea in confession and avoidance" at common law), in which he admits the facts regarding his use of a firearm, but asserts what is otherwise an affirmative defense, thus potentially obviating the cost of a trial, and for all the same reasons that the courts use in justifying "qualified immunity" in 1983 actions.
There is another area that's a "kinda, sorta": mobile or transient "homes", such as tents, mobile homes, and vehicles. There has never been a case on point as near as I can tell in Virginia, although trailer homes are routinely treated as residences for search and seizure purposes. The idea that a mobile residence (tent, mobile home, travel trailer) is a home has never been established. I think it could be and is a logical application of current law. I think it'd be the same thing as far as defense of the self, family, and home are concerned. So this isn't too big a stretch, if it's a stretch at all.
Finally, and what is new and different, is the idea of an award of attorneys' fees in any action, criminal or civil, for the defendant who successfully defends on the basis of an affirmative defense. The problem I am attempting to address here is what I've heard cops refer to as "punishment by lawyer". They know perfectly well that they've instituted bogus charges and that with a decent attorney the defendant will be acquitted or the charge will be nolle pross'ed. But they also know that an attorney's fee will be many multiples of the potential fines and costs, and that's in addition to the stress and inconvenience of being arrested, charged, jailed, and having to defend at trial. Similar concerns on the civil side obtain as well. If there were some reason to be more circumspect in bringing bad charges and false complaints, then this problem may be ameliorated. It really represents a sort of compromise, in my opinion, because it doesn't include all the damages one might assert in follow-on litigation for abuse of process, battery, false arrest, false imprisonment, and malicious prosecution; but if people will settle for reimbursement of their legal fees, they might be less likely to institute retaliatory lawsuits.
One thing I see as potentially controversial is the issue of no-knock searches. Under the castle doctrine as received in Virginia law, there is no authorization for a no-knock search, whether or not supported by a warrant. The Virginia Sup. Ct. routinely asserts that whatever the federal courts decide with respect to the federal Constitution applies to Virginia. I suggest that the federal Fourth Amendment minimum standards regarding to the definition of "reasonable" in that context is just that, a minimum standard. If the Virginia Supreme Court were to apply Virginia law on such issues, there would be no violation of federal minimum standards, because Virginia law is more protective of citizens' rights than those standards would allow. The castle doctrine is one such protection, which is the original standard for all American jurisprudence on the necessity to announce one's presence, office, and reason for entry, giving time for residents to allow a peacable entry, and serving papers justifying the entry,before the ninja-attired storm troopers come in with guns pointed at the family with fingers on the triggers. My feeling is that absent a genuine emergency (an immediate and objectively perceived threat to life, limb or property) there is no justification for a no-knock entry. If, on some occasions, drugs get flushed and evidence is lost, that's better than having the rights of Virginia citizens lost.
I assert that the remainder of what I've written is supported by common law of Virginia and only represents a codification of what is. As a practical matter, whenever I use the common law castle doctrine in a criminal action, the prosecutors uniformly start rolling their eyes and talking about historical anachronisms, and General District judges are not generally the sort of legal scholars who are willing to consider the common law as it was in 1607 as in any way guiding their decisions. Moreover, they are likely to take opinions of the Supreme Court as gospel in the interpretation of statutes where there is no need for an appeal to precedent, because the statute is perfectly clear and unambiguous. The result is the application of peculiar fact situations in uncertain cases (why else would they have been heard in that court) to cases that are fairly straightforward. The same thing happens with respect to the common law. Under our Constitution, the judicial branch is not free to make up new law as was the Court of King's Bench, because it, unlike the latter, does not represent the sovereign as a whole. Only the legislature can change the common law as incorporated by Va. Code sections 1-200 and 1-201.