VBA's memory viewer. 0x02024284 contains your team's stats. Make a copy of this script, and see where the lost Pokémon's data is moved to.
If it's not moved (the data simply disappears), then the game has no way of remembering the Pokémon deposited, and no return Pokémon script can be made from this script. If it is moved, well... good!