>>>If Vigano were elected, he could rescind his excommunication with the stroke of a pen.
Thinking like a computer programmer here... If he’s not considered Catholic (i.e., he’s outside the Catholic Church) then he would not be a valid candidate. If he were elected, his election would not be valid, and therefore he would not have the authority to lift his own excommunication.
An excommunicated Catholic is still a Catholic. He’s a Catholic who is prohibited from receiving any sacraments until he manifests his repentance to the required authority. He is still, for example, under obligation to hear Mass on Sundays and Holydays, even though he can’t receive communion.