I doubt Boxer would use a strategy like that, and if you have a replay of it, I'll bet it's not the real Boxer in the replay. A smart player would build a turret at the higher ledge in his base near the ramp, then start building another turret at the lower ground but close enough to the first turret that if the DT tries to hit the lower turret, he'll be spotted and shot down. In both cases, using 3 scv, and building 2 turrets cost 150 minerals. But one system you dont lose anything, but gain 2 turrets, other system you lose 3 scvs.
I've been attacked by DT before as terran when I had no turrets available. Turrets are quick and easy to build, so you just build 1 out of sight of the DT, then build another closer towards where the DT is.. sorta like a Turret push.. just run your other scvs around if he's trying to target them.