Here is the cron that we are using since past few months. This code checks for pending orders for more than 7 minutes age to 30 minutes and cancels them. For me this restores the inventory.
public function cancelPending()
{
$orderCollection = Mage::getResourceModel('sales/order_collection');
$orderCollection
->addFieldToFilter('status', 'pending')
->addFieldToFilter('created_at', array('lt' => new Zend_Db_Expr("DATE_ADD('".now()."', INTERVAL -'0:07' HOUR_MINUTE)"),
'gt' => new Zend_Db_Expr("DATE_ADD('".now()."', INTERAL -'0:30' HOUR_MINUTE)")));
foreach($orderCollection->getItems() as $order)
{
$orderModel = Mage::getModel('sales/order');
$orderModel->load($order['entity_id']);
if(!$orderModel->canCancel())
continue;
$orderModel->cancel();
$orderModel->setStatus('canceled');
$orderModel->save();
}
My default status for an order pending payment is "pending". you may have to change that.