It seems the moment a hostile fleet arrives, it blockades a system even if there's a fleet defending the system, and the blockade is triggered even if the defending fleet attacks the invading fleet and wipes them out (this I can tell by the fact that doing so triggers new Resource notifications). In my mind, the blockade should not even be triggered if and when the defending fleet blockading the system is destroyed.