First-order supersymmetry (SUSY) adapted from quantum physics to optics manipulates the transverse refractive index of guided-wave structures using a nodeless ground state to obtain intended modal content. Second-order SUSY can be implemented using excited states as a seed function, even with the presence of nodes. We apply second-order SUSY to the coupled-mode equations by recasting them as the Dirac equation. This enables the engineering of non-uniform surface corrugation of waveguide gratings and coupling potential, which encapsulates the Bragg interaction between counterpropagating modes. We show that the added bound states appear as transmission resonances inside the bandgap of the finite grating. The probability density of each state provides the longitudinal modal energy distribution in the waveguide grating. The smooth modal energy distribution of the states obtained by SUSY can mitigate longitudinal spatial hole burning in high power laser operation. We demonstrate that degenerate second-order SUSY allows the insertion of two states, which can coalesce into Friedrich-Wintgen type bound states in the continuum (BIC) for one-dimensional grating. We show that the eigenfunctions of BIC states are doubly degenerate with opposite parity, and the corresponding transmission resonances have phase changes of 2π across these states. One-dimensional BIC states can find application as robust high-speed all-optical temporal integrators by lifting restrictions on the length of various sections in the phase-shifted grating.