Effect of substitutional doping and disorder on the phase stability, magnetism, and half-metallicity of Heusler alloys