Try below script
$entityType = Mage::getModel('catalog/product')->getResource()->getEntityType();
$collection = Mage::getResourceModel('eav/entity_attribute_set_collection')
->setEntityTypeFilter($entityType->getId());
foreach ($collection as $attributeSet) {
if($attributeSetId = $attributeSet->getId()) {
/** @var $catalogProductsCollection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */
$catalogProductsCollection = Mage::getModel('catalog/product')->getCollection()
->addFieldToFilter('attribute_set_id', $attributeSetId);
if (count($catalogProductsCollection) == 0 ) {
$attributeSet = Mage::getModel('eav/entity_attribute_set')->load($attributeSetId);
try {
$attributeSet->delete();
} catch (Exception $e) {
echo $e->getMessage();
}
}
}
}
Note : first backup your database after run script