Ok, solved this for us. Here's what I did.
First I created a textarea attribute (code: attribute_order_override) for configurable products to allow the content editors to enter a JSON snippet like this:
{
"color": [
"Athletic Grey",
"Athletic Blue"
]
}
Then in app/design/frontend/.../default/template/catalog/product/view/type/options/configurable.phtml. I created an "order reference array":
$orderReferenceArray = array();
$attributeOrderOverride = $_product->getResource()->getAttribute('attribute_order_override')->getFrontend()->getValue($_product);
if ($attributeOrderOverrideArray = Mage::helper('core')->jsonDecode($attributeOrderOverride, true)) {
foreach($attributeOrderOverrideArray as $k => $v) {
if (is_array($v) && count($v) > 1) {
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', $k);
$orderReferenceArray[$attribute->getAttributeId()] = array();
$options = $attribute->getSource()->getAllOptions(false);
foreach($v as $k2 => $v2) {
foreach($options as $option) {
if ($option['label'] === trim($v2)) {
$orderReferenceArray[$attribute->getAttributeId()][$option['value']] = $option['label'];
}
}
}
}
}
}
Then, in our case, we in our catalog helper, $this->helper('catalog'), we parse the JSON configuration from Magento with PHP to build our attribute structure. So before we build out the HTML, I check if there's an overriding "order reference" for these attribute options, and, if so, swap the options around. Otherwise, they'll use the position set in the Attribute in the admin area:
$configData = Mage::helper('core')->jsonDecode($jsonConfig, true);
if (count($orderReferenceArray) > 0) {
foreach($configData['attributes'] as $k => $v) {
if (count($v['options']) > 1 && isset($orderReferenceArray[$k])) {
$tmpOptions = array();
foreach ($v['options'] as $v2) {
$tmpOptions[$v2['id']] = $v2;
}
$configData['attributes'][$k]['options'] = $this->sortArrayByArray($tmpOptions, array_keys($orderReferenceArray[$k]));
}
}
}
And the sortArrayByArray method is:
public function sortArrayByArray($array,$orderArray) {
$ordered = array();
foreach($orderArray as $key) {
if(array_key_exists($key,$array)) {
$ordered[$key] = $array[$key];
unset($array[$key]);
}
}
return $ordered + $array;
}