The application of dirt onto the surface of retouched/inpainted areas is seldom required. However there are situations when such a step is necessary in order to blend seamlessly the retouched areas with the rest of the painting.
The first, the most obvious, is in the case of paintings that are not, for various reasons, completely cleaned prior to retouching. The decision to leave dirt on the painting may be dictated by the requirements of the owner of the painting, or may be based on aesthetic reasons. Primitive paintings or antique polychromed objects serve as good examples where patina is a desired part of the object.
The other situation when the application of dirt helps in blending reconstructed or retouched areas with the original paint is in the case of paintings where the dirt is permanently embedded in the paint layer.