Before providing a possible solution I want to say: "DON'T DO IT". If you take this approach and have n-hundred users subscribed to a product then the save process on the product has to wait for n-hundred e-mails to be sent. This will make the product management a living hell. Also if you decide to put in stock X products (X > 1) in a short period of time and a customer is subscribed for alert on all those products, he will receive X e-mails in a few minutes. That becomes annoying and he will never subscribe again.
I think the best approach here, if you want to sent e-mails more than once a day is to make the cron run every hour, or every X hours. (not the same X as above).
But here is a possible solution to what you want. You need to create an observer on the catalog_product_save_after
event.
Add this in the config.xml of your module
<adminhtml>
<events>
<catalog_product_save_after>
<observers>
<[moudle]>
<class>[module]/observer</class>
<method>checkStockChange</method>
</[module]>
</observers>
</catalog_product_save_after>
</events>
</adminhtml>
Now create the observer: app/code/local/[Namespace]/[Module]/Model/Observer.php
<?php
class [Namespace]_[Module]_Model_Observer extends Mage_ProductAlert_Model_Observer{
//it must extend Mage_ProductAlert_Model_Observer so you won't duplicate code
public function checkStockChange($observer){
$product = $observer->getEvent()->getProduct();
$stock = $product->getStockItem();
if ($stock->getIsInStock() == 1 && $stock->getOrigData('is_in_stock') == 0){
$this->_processStock( Mage::getModel('productalert/email'));
}
}
}
This will send out all the e-mails for all the products that come back in stock, but since you are calling this when each product that comes back in stock, then only that product should be processed.
And in case you missed it at the top of this answer, here it is again: DON'T DO IT