Security and transient stability (TS) constrained OPFs do not include network switching and often require excessive computation time due to discretization of the TS model. This paper proposes a non-simulation methodology to optimize active power dispatching and network switching to ensure TS and system security in the preventive control mode. Network switching is introduced in the security constrained OPF and classical TS models, giving a general <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">dynamic</i> security and TS constrained OPF. To ensure TS constraints are manageable in the optimization framework, TS is assessed by using proposed non-simulation based proxy measures. To this end, the key factors impacting TS are investigated and new composite robustness metrics for TS assessment are proposed; they consist of two terms, the nodal and network topology metrics. The former models generator features just before a fault, whilst the second considers impact of a fault on units. The general problem is then decomposed into two stages, the first being economic dispatching and the second optimization of network topology for TS via developed network robustness metrics. The minimum cost topology solutions are ranked by the TS performance. The proposed approach is tested on the IEEE68 Bus test system and compared with time-domain TS results.