Technical debt as a lack of understanding
I wonder if an intermediate step between "not understand what the code is doing" and "modify the code to reduce technical debt" might be "do some archaeology and document the discoveries (preferably, in the code itself)"?