Spectrum of CMB vs. duration of last scattering The epoch of last scattering took over 100,000 years. The Visibility Function has maximum at about 370,000 years after the Big Bang when the temperature was about 5,600 K. 50,000 years earlier the temperature was around 6,000 K and 50,000 years after the maximum it was approximately 5,200 K (I used this tool to do the calculations).
The temperature difference at the beginning and the end of the last scattering epoch is about 800 K. At 6,000 K the spectrum peaks at 483 nm while at 5,200 K the peak is 557 nm. Some of the CMB photons we see today come from the earlier stage of last scattering, some of them from the later stage, so the resulting spectrum would be a convolution of spectra from various times. However the spectrum is not distorted: it looks perfectly like a blackbody spectrum.
Does it mean the CMB photons were cooling at the same rate as the plasma? So all photons which decoupled earlier cooled down (due to expansion of the space) just right to perfectly aligh their wavelengths with the photons that decoupled later on?
 A: The best explanation I have seen is in Creation of the CMB spectrum: precise
analytic solutions for the blackbody photosphere
The temperature of CMB was not defined by the last scattering, which was at about z=1100.
Instead, the black body spectrum was defined earlier at about z = 2,000,000.  Prior to z=2,000,000, the universe was in complete thermal equilibrium.  Distinct from the photosphere of last scatter, the earlier photosphere is referred to as the blackbody photosphere.  "The blackbody spectrum, once created at high redshifts, is preserved by the adiabatic expansion of the Universe at all subsequent times." 
The spatial variations of the black body spectrum were defined at z=1100 by the surface of last scatter. The finite width of the visibility function limits the ability to determine very small angle variation is temperature anisotropy. 
(Also, the temperature during the epoch of last scattering was between 3000 and 4000K, rather than the higher values in the OP, but this is not important to the answer.) 
