If you want to do something that works "like Lunar Dance/Healing Wish", just check the code for them and try to adapt it :)
Hint:
You will have to define a new PBEffect for your reviving move, initialize it in the right place (should be in the class PokeBattle_ActivePosition), and a subclass of PokeBattle_Move to set the PBEffect. Also you will need a function to revive the Pokémon (take inspiration on the Revive item), and finally a trigger to use this function in battle after the effect was set (you should put that trigger in pbOnActiveOne, right before the code that triggers the entry hazards like Stealth Rock).