I tried the following changes in attributes.php and appears to get you part of what you want.
removed the following line:
and (pwas.quantity > 0 or pwas.quantity IS NULL)
Altered the else where setting the text output.
else
{
if($products_options->fields['quantity'] == 0) {$products_text_to_use = $products_options->fields['products_options_values_name'] . " (Sold Out)";} //improperly hard coded
else {$products_text_to_use = $products_options->fields['products_options_values_name'];}
}
Everything is possible, but this is beyond my ability. I would think this might need to be some JavaScript coding or something else browser side.