So here's a thought. Why not, after 24 or 48 hours of your Pokémon being undefeated in the gym, if you physically go back to the gym you should be given the option to pick your Pokémon back up and collect your coins and then drop a different Pokémon in. In some towns, I've got Pokémon that have been there for almost a month and if I could pick them back up, and the coins, that'd be grand. Maybe have it so that you're only allowed to collect them 3 or so times before you're locked from swapping out and someone has to take the gym over before you can do it any more.