In many cases, the safety and the reliability of a warm standby system heavily rely on the successful activation and the subsequent operation of its standby components. Optimal inspection and maintenance schedule is one of the most common but essential activities in the real world applications to manage standbys effectively and efficiently. In this paper, we propose a novel state-based method by incorporating inspection activities into multiphase Markov process to model the dynamic behaviors of a general repairable k-out-of-n: G warm standby system with common-cause failures. Here the effects of inspection errors are taken into consideration. Then the expected total cost and the average unavailability of the system are expressed as exact closed formulas regarding the inspection interval (or inspection frequency) in a cycle. Finally, the inspection and maintenance optimization problem is formulated as a nonlinear optimization program which aims to find the optimal periodic inspection interval on a finite time horizon by minimizing the expected total cost while taking into account the limitation of the average unavailability. The proposed modeling approach can be used in various industrial systems, where inspections and standbys are especially necessary, e.g., a feedwater subsystem of a nuclear power plant. A simplified numerical example illustrates the models and the calculations with sensitivity analysis and Monte Carlo simulation.