Your procedure can be described by:
- Track Unit Dies Event
- Check within specific condition if dying unit equals to your chosen unit
- Actions: remove dying unit from the game
- Action2: create "cage" (unit/dest?) on map and set its location to the dying unit's one.
In GUI there is even an action regarding to "replace" functionality, although it refers only to unit-unit replacements.
Clean memory leaks. Enjoy.