Yeah, you need to start far away, otherwise you wont kill it before it gets to you. If it's already pretty close then don't bother.
Also you should probably be using a combat shotgun if you can get the corner trick to work, it will keep pushing the cacodemon back, and the closer it gets the more damage you do.
Oh, and some clarification on the corner trick:
The enemy must be very close to the wall you're shooting around, while this will probably work:
......
.....O
@####.
.####.
.####.
This will probably result in the cacodemon shooting you:
....O.
......
......
@####.
.####.
.####.
Also they can't be too close to YOU, if the cacodemon is about this far away:
......
..O...
@####.
.####.
.####.
Then it's time to consider running away, unless it's on low HP.
I better put all of this in to v1.3...