I have used the below code for create the customer group programmatically, it works well. But i need that if the same customer group exist it should update the values, instead of creating new one with same name.
$customer_group=Mage::getModel('customer/group');
$customer_group->setCode($typename.'_'.$id);
$customer_group->setTaxClassId(3);
$customer_group->save();