Possibility of changing the dynamic parameters of localized breather and soliton waves for the sine-Gordon equation in the model with extended impurity, variable external force and dissipation was investigated using the autoresonance method. The model of ferromagnetic structure consisting of two wide identical layers separated by a thin layer with modified values of magnetic anisotropy parameter was taken as a basis. Frequency of external field is a linear function of time. The sine-Gordon equation (SGE) was solved numerically using the finite differences method with explicit scheme of integration. For certain values of the extended impurity parameters a magnetic inhomogeneity in the form of magnetic breather is formed when domain wall passes through it with constant velocity. The numerical simulation showed that using special variable force and small amplitude it is possible to resonantly increase the amplitude of breather. For each case of the impurity parameters values, there is a threshold value of the magnetic field amplitude leading to resonance. Geometric parameters of thin layer also have influence on the resonance effect — for decreasing layer width the breather amplitude grows more slowly. For large layer width the translation mode of breather oscillations is also excited. For certain parameters of extended impurity, a soliton can form. For a special type of variable field with frequency linearly dependent on time, soliton is switched to antisoliton and vice versa.