Metastable state abundances in multiply charged ion beams