I was an Emperor and all the HRE elector members are at war with me, so I was the only one who could vote. Justinian was dead for few centuries

-- I think the code picked him as the first in the general list of leaders. In the cases like this the only eligible voting member should be able to vote for himself, IMO. Otherwise please see below about my idea with Pope's vote.
In short -- HRE system is an (unpolished) gem. We need something like this for regular RFCE as well. Austrias UP will help her to get elected to the Emperor.
Here are my suggestions for RFCE++:
1. Rome is an Imperial City. We badly need to include Church's vote -- this is
Holy Roman Empire after all. Bishops were among electors from the beginning. And, at least from the thirteenth century, there were seven electors, three
spiritual (the Archbishop of Mainz, the Archbishop of Trier, and the Archbishop of Cologne) and four lay (the King of Bohemia, the Count Palatine of the Rhine, the Duke of Saxony, and the Margrave of Brandenburg. Every imperial city with a catholic cross gives Pope 1 vote, Monastery -- 2, Church -- 3 and Cathedral -- 5. Pope can never be elected and votes randomly for the player with the highest Piety and lowest score (Popes don't like strong Emperors, but sometimes supported those who could be Protectors of Church). In the cases like in my posted picture Church's vote will insure that somebody will be elected. Also, elected Emperor receives a Crown

from the Pope in exchange for a tech. This way Pope will get free techs from every election and if there are no new techs to give to Pope -- the Pope does not crown the elected Emperor. After the reformation Catholic Church will have very little votes.
2. Vanila Vassal System and HRE system overlapping with some crazy results. Burgundy was volunteer vassal of Germany. If Germany defies the resolution (Never!) and Burgundy is the Emperor -- vassal must declare on her master! Also masters end up electing their vassals. And there are many other confusions. I suggest that civs with the capitals inside HRE cannot have HRE vassals and cannot be vassals to HRE state themselves. This way HRE mechanics will not interfere with regular vassal rules.
3. Germany is currently very strong and acting like a 2nd Reich, not like the 1st. HRE mechanics has a potential to realistically simulate decentralization of Germany. Emperor should be able to propose 2 new measures: Stopping the Wars (
Peace and Truce of God) and creating defensive
March or Mark -- taking from Germany some newly conquered border city and making it "peaceful" independent city. By the way -- Independent Leader must be able to vote too! So when playing Germany Human Player would need either to keep high Piety to compensate for high score and get the vote of the Church, or be nice with other HRE members to get their vote. Otherwise stability might get low when loosing a city because of the Emperor.
4. There should be no "Abstain" vote and at least 2 alternatives ("Guelph" and "Ghibelline") when voting for Emperor. If no alternative is available, i.e. Germany took over Burgundy, Lombardy, Bohemia and Austria or only 1 HRE member is eligible to vote (like in my case) -- then Germany is allowed to vote for herself and Church is voting for "virtual" Guelph Independent leader (who has no cities but still bugs Germany as elected Emperor).