It doesn't work because method onProcessProductMassActiondeleteElements() is completely broken.
Only scenario when it partially works is when limit is more then 500.
Then exactly 500 records are deleted.
Here is fix:
function onProcessProductMassActiondeleteElements(&$elements,&$action,$k, $start = 0){
$ids = array();
$c = count($elements);
for($i = $start; $i < $start + 500 && $i < $c; $i++)
{
$ids[] = $elements[$i]->product_id;
}
$productClass = hikashop_get('class.product');
$productClass->delete($ids);
if($i < $c)
{
$this->onProcessProductMassActiondeleteElements($elements,$action,$k, $start + 500);
}
}