Efficient procedure for the evaluation of multiple scattering and multiphonon corrections in inelastic neutron-scattering experiments