If you're using Emerald:
There are ASM routines for checking specific species of Pokemon.
I suggest using special 0xA2, which opens the Pokemon menu and lets you pick a Pokemon, you can then check if that Pokemon is Deoxys, and then change it accordingly.
Here's a tutorial about how to use it:
https://www.pokecommunity.com/showthread.php?t=397735
In case you don't want to use special 0xA2, there's another ASM script that just checks if a specific species of Pokemon is in the player's party.
I couldn't find it again, but it's on PokeCommunity somewhere.
If you're using FR:
Use Emerald
.
.
.
.
.
.
There's already a built in checkpokemon, however I don't know how it works as I don't hack Fire Red so you do your research. Again, it's here on PokeCommunity.
Also hack Emerald.