The best system I can think of for this is special formation decisions for Italy and Germany while the HRE exists that are only available to non-emperors. By making the decision, you formally request that the Emperor give you the title. If he refuses (which he almost certainly will as accepting gives -IA and -prestige), then you can attempt to force the issue by war or let it go until the new emperor is elected. If you're given the title by the emperor, you remain in the HRE as that new kingdom. If you get the title through war, then you're removed from the HRE but also have the option of disbanding the HRE in the process, if you want.
- 4