The self-consistent Theory of Finite Fermi Systems (TFFS) is consistently generalized for the case of accounting for phonon coupling (PC) effects in the energy region of pygmy-and giant multipole resonances (PDR and GMR) in magic nuclei with the aim to consider particle-hole (ph) and both complex 1p1h⊗phonon and two-phonon configurations. The article is the direct continuation and generalization of the previous article [S.Kamerdzhiev, M.Shitov, Eur.Phys.J.A. 56, 265 (2020)], referred to as [I], where 1p1h-and only complex 1p1h⊗phonon configurations were considered. The newest equation for the TFFS main quantity, the effective field (vertex), which describes the nuclear polarizability, has been obtained. It has considerably generalized the results of the previous article and accounts for two-phonon configurations. Two variants of the newest vertex equation have been derived: (1)the first variant contains complex 1p1h⊗phonon configurations and the full 1p1h-interaction amplitude Γ instead of the known effective interaction F in [I], (2) the second one contains both 1p1h⊗phonon and two-phonon configurations. Both variants contain new, as compared to usual approaches, PC contributions, which are of interest in the energy region under consideration and, at least, should result in a redistribution of the PDR and GMR strength, which is important for the explanation of the PDR and GMR fine structure. The qualitative analysis and discussion of the new terms and the comparison to the known time-blocking approximation are performed.