Resonant structures in the excitation functions of elastic and inelastic scattering of 16O on 24Mg