egrad uses the same general keywords as escf and grad, see Sections 15.2.8 and 15.2.10.
The state to be optimized is by default the highest excited state specified in $soes. Note that only one IRREP can be treated at the same time in contrast to escf calculations. When the desired excited state is nearly degenerate with another state of the same symmetry it may be necessary to include higher states in the initial calculation of the excitation energy and vector in order to avoid root flipping. This is accomplished by means of the additional keyword
which explicitly enforces that n-th excited state is optimized. n must not be larger than the number of states specified in $soes.