A coupled-mode theory is derived from the scalar wave equation for the interaction between forward-and backward-traveling waves in a general slowly varying coupled waveguide array containing an arbitrary number of guides with a grating overlay. The equations include the effects of nonnegligible model overlap terms and changes in modal overlap but still demonstrate power conservation. Numerical results are presented for a contradirectional track-changing filter, which show that the modifications made to the equations are significant for practical devices.