Determine if customer is new in customer_save_after
First of all you can define your observer as singleton for both events
<global>
<events>
<customer_save_after>
<observers>
<namespace_module>
<type>singleton</type>
<class>namespace_module/observer</class>
<method>doSomething</method>
</namespace_module>
</observers>
</customer_save_after>
<customer_register_success>
<observers>
<namespace_module>
<type>singleton</type>
<class>namespace_module/observer</class>
<method>doSomething</method>
</namespace_module>
</observers>
</customer_register_success>
</events>
</global>
In this case the same observer object will be used for both events. So you can create flag in your observer and before doing some actions check it.
class [Namespace]_[Module]_Model_Observer
{
protected $canDoSomething = false;
public function doSomething($observer)
{
if (!$this->canDoSomething) {
//here your code
//now set flag to true to prevent executing your code twice
$this->canDoSomething = true;
}
}
}
Now your code will be executed only once.