What are you after here? Punish players? Justice?
A think a better solution would be that if you logout during "danger" you are only allowed to log back in to the same game mode you logged out from while in danger for 24 hours.
Example:
I play in open, and I am in a fight and is loosing, so I use the menu logout with timer to exit the game, to avoid destruction.
Now I can only log back into open for 24 hours.
To clear the 24 hour timer, we have a 2nd timer that starts when you log back in, that is 5 minutes, and if you are in game for 5 minutes, and then logout without being in danger, then you are free to choose game mode as you wish. This is to stop people to using the system to login back in and then as fast as possible to logout again, before they end up being in danger, so they could switch game mode. Now if there are players "camping" your last position they have a fairly good chance to put you in danger again... resetting your 24 hour timer to 24 hour.
I do not expect this be of any major disturbance to PvE players, who uses this avoid destruction from NPC ships. as they would not be in any danger when they login again. So this would mostly affect PvP combat interactions.