It was all right they said... just wanted to throw in you would not need these local declarationen in that case.
TriggeringUnit/DyingUnit also work with combination with the wait-function, so you can set a normal globalVariable = TriggeringUnit after these 25 seconds.
And btw GetUnitName was not the correct function to get the UnitType. The correct one would be GetUnitTypeId(whichunit) ... and returns an integer.
Also "Owner of tempUnit" would be invalid I think, because you remove the "tempUnit" one line before.