It's a mixture of Mantyke's evolution (number 21) and a held item-based evolution (numbers 6/18/19).
In def pbMiniCheckEvolution, do a copy of method 21. In def pbEvolution, look for where Shedinja and the held item-based evolutions are mentioned, and add something similar which will look for and delete the first Shellder in the party (if your new method is used, obviously).
This will restrict your new evolution method to just one checked-for species (i.e. Shellder). You couldn't use the same method for both Slowpoke and Beldum, for example, because they would each need to delete a different Pokémon species. You could certainly add more code to allow for a one-method-fits-all, but it's easier to just make another evolution method for Beldum instead. Assuming you're using this method for more than one species, of course.
It strikes me that this method is extremely unfair, though. The player loses a Pokémon without warning, and without indication of which Pokémon is being deleted. There might also be an issue of the deleted Pokémon being your only remaining unfainted Pokémon, but you probably don't have to worry about that.
Personally, I would go for a different method and allow fishing with Slowpoke. If the hooked Pokémon is a Shellder (and optionally if Slowpoke is level 37 or higher), cause an evolution instead of a battle. It's more complicated to do, but much more fair.