The Virginia Republican Party, if it wished, could probably win a lawsuit against the ban on write-ins in its own 2012 presidential primary. Winning against the ban on write-ins would make it possible for Virginia voters who vote in that primary to have a free choice of candidates.
The Virginia Constitution, Article II, section 3, says, “In elections other than primary elections, provision shall be made whereby votes may be cast for persons other than the listed candidates or nominees.” Because this section protects write-in voting in general elections, all Virginia ballot-counting machines are able to handle write-in votes.
The only possible purpose for excluding primaries from the write-in guarantee is to protect the interest of parties. But a party that wants write-ins in its own primary ought to have the constitutional clout to demand it. The U.S. Supreme Court has protected the ability of political parties to control their own nomination process, especially in the recent party rights decision, New York State Board of Elections v Lopez Torres, 552 U.S. 196 (2008). Also, Virginia state courts have always recognized a strong role for political parties in the nominations process.