External control of a genetic regulatory network is used for the purpose of avoiding undesirable states, such as those associated with disease. Heretofore, intervention has focused on finite-horizon control, i.e., control over a small number of stages. This paper considers the design of optimal infinite-horizon control for context-sensitive probabilistic Boolean networks (PBNs). It can also be applied to instantaneously random PBNs. The stationary policy obtained is independent of time and dependent on the current state. We concentrate on discounted problems with bounded cost per stage and on average-cost-per-stage problems. These formulations are used to generate stationary policies for a PBN constructed from melanoma gene-expression data. The results show that the stationary policies obtained by the two different formulations are capable of shifting the probability mass of the stationary distribution from undesirable states to desirable ones.