Best practice for extending a modules functionality?

As an example, let’s say I’ve added a custom field for the yii-user module to ask for a user’s twitter username. If I want to download the user’s twitter followers and friends at registration time during the save() function, where should I place this code so that when I upgrade yii-user in the future it doesn’t get overwritten? As a new module within the yii-user module itself? As a component in modules/yii-user? or someplace else?

Extending yii modules