Spectroscopy and gain dynamics issues in inhomogeneous X-ray laser plasmas