Energy accumulation and dissipation in metals as a result of structural-scaling transitions in a mesodefect ensemble