Sorry, that was a really shitty way to describe it. Even I can't understand what I meant. My mind works better with real numbers, so let's just do this:
Buy - 100,000
New roof - 10,000
Depreciation for a few years - 20,000
Sell - 160,000
Commission & other costs - 9,000
Depreciation recapture = 20,000 * 25% + state
Capital gain = 41,000 * 15% (likely) + state
160 - 100 - 10 - 9 = 41.
So you don't add back depreciation for the cap gain, but it gets added back in as part of the total gain, which would then be 61,000.
So yes, you are correct. Sorry for any confusion. And good catch.