Yes; as long as the Pokemon goes back into its Pokeball Regenerator will activate, whether its forced out or is switched out by its trainer.
Source: Experience