Motivated by the result of invariance of regular-boundary open sets in [9] and multi-stability issues in gene networks, our paper focuses on three closely related aims. First, we give a necessary local Lipschitz-like condition in order to expect invariance of open sets (for deterministic systems). Comments on optimality are provided via examples. Second, we provide a border avoidance (near-viability) counterpart of [9] for controlled Brownian diffusions and piecewise deterministic switched Markov processes (PDsMP). We equally discuss to which extent Lipschitz-continuity of the driving coefficients is needed. Finally, by applying the theoretical result on PDsMP to Hasty's model of bacteriophage ([24], [12]), we show the necessity of explicit modeling for the environmental cue triggering lysis.