Before a unit starts reviving, the altar makes a special revive order. For the altar's very first hero it will be always 852027, for the second 852027+1, then 852027+2, etc, etc.
You need a queue like data strcuture, something where you can enqueue and dequeue data -- so each time when a building makes such a order from 852027 to 852027+4 (if max hero is 4) then the building gets into the queue.
The next thing what happens is that the event "a unit starts reviving" will fire. When this happens you put the reviving unit into data structure, a unit group, or so. You must bind the respective altar unit to the reviveable unit here. We use the queue from above to find the needed altar, it will be always the first one in the altar queue. (the altar can be un-queued now, so the next one moves at first position)
So now we basicly have a reviveable unit instance, and the respective altar binded to it.
We can periodicly make a order for the altar forcing it to revive <unit>, and the function will return true if it succeded, and false, if not.
So, if the order returns false, it means it's still being revived, but if it returns true, it means it's not in the revive queue anymore. So it was either cancled, or what ever.
Then you can run your custom event here, that the altar canceled the revive.
There of course also need to be events that un-register the whole thing, in case a unit finished reviving, etc.
It's not really a straight forward way, but atm I wouldn't know a better one.