Magento: How do I get attribute set name & id?

Whenever you have a product object, you can access its attribute set like this:

$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName  = $attributeSetModel->getAttributeSetName();
$attributeSetID  = $attributeSetModel->getAttributeSetID();

This will give you the name of the attribute set, which you can then compare using strcmp:

if(0 == strcmp($attributeSetName, 'My Attribute Set') {
    print $product->getAttributeText('attribute');
}

Hope that helps!
Source:
http://stackoverflow.com/a/2095238