My approach is to highlight technical pain points during the week and at the end of the week vote on the biggest pain point and then allocate a fixed amount of time to work to fix that in the next week.
Usually there are about 10-12, 7 of which can be safely ignored and 1-2 which are critical.
"pain points" is a good expression here. Some code inflicts more pain on the developer than other and the psychological effects should not be underestimated (=reduction of productivity due to lower morale).
I also like your approach of time-boxing the fixes.
Usually there are about 10-12, 7 of which can be safely ignored and 1-2 which are critical.