Molecular dissociation and vibrational excitation in the surface scattering of (N2)n and (O2)n clusters