Dynamics of the transverse Ising model with next-nearest-neighbor interactions