  Motivated by the result of invariance of regular-boundary open sets in
\cite{CannarsaDaPratoFrankowska2009} 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
\cite{CannarsaDaPratoFrankowska2009} 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 (\cite{hasty\_pradines\_dolnik\_collins\_00},
\cite{crudu\_debussche\_radulescu\_09}), we show the necessity of explicit
modeling for the environmental cue triggering lysis.
