This really does not seem like it should be difficult. I seem to be able to change a product's status for a given store, but not read it.
Below is a test script I've been using,
<?php
// Make this a Magento app
require_once '/var/www/html/magento/app/Mage.php';
Mage::app();
echo "Loading product ".$argv[1]."\n";
$product = Mage::getModel('catalog/product')->setStore(2)->setStoreId(2)
->load($argv[1]);
echo "Product id is ".$product->getId()."\n";
echo "Product status is now ".print_r(Mage::getModel('catalog/product_status')->getProductStatus($product->getId(),2),true)."\n";
// This always prints:
// Product status is now Array
// (
// [498] => -1
// )
echo "enabling product... ";
Mage::getModel('catalog/product_status')->updateProductStatus($product->getId(), 2, Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
echo "done\n";
// This actually seems to work, and change the status of the product in that store's view.
echo "Product status is now ".print_r(Mage::getModel('catalog/product_status')->getProductStatus($product->getId(),2),true)."\n";
// This always prints the same -1 response as the first time
?>
And that's it. Pretty short and simple, and changing the product status in store 2 does appear to work, just not reading it.
Interestingly enough, both things do work if I use this:
echo "Product status is now ".$product->getStatus()."\n";
echo "enabling product... ";
$product->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)->save();
echo "done\n";
echo "Product status is now ".$product->getStatus()."\n";
Except, after running that, in the store view all the attributes that had been set to "use default" now aren't. As a last resort that might work, but definitely not what I had in mind.