Agree that governments have restricted civilian traffic. However, in this case that could be abused to exactly direct civilian traffic to a desired destination bu placing every other route out of bounds. If you can come up with a mechanic to implement your suggestion on an emergency basis without the potential for full-scale abuse, then I will add something on those lines.
Well, there's two problems here. The first is that for some systems you
really want to more or less indefinitely keep them from being used by civilians. Like with Jumpgate linked systems when there's [spoilers] or an NPR making a mess of it when you've got colonies at either end. It would be inconvenient to have half your civilian cargo fleet commit suicide because the danger rating lapsed but you haven't managed to clear out the threat.
The other problem is that the ability to precisely define the interstellar movements of civilian ships is apparently not desired.
There's two possible solutions I see, both of which are to do with the cost of enforcing a danger rating. The first is that you add PVV/tonnage of friendly military ships to civilian routing/danger level calculations for restricted systems. The bigger the difference in distance the less civilian ships care about danger/restriction ratings, so as that difference increases you need to add more and/or bigger ships to maintain the barrier. Having to dedicate half your fleet on sitting on a system so civilians do not do something they're not supposed to do is inconvenient.
The other option is that restricting a system costs wealth to impose, and an escalating amount of wealth to keep up while cancelling a restriction causes a cooldown based on how long a system has been restricted before it can be restricted again without eating a massive wealth penalty.