Yes, change this:
eat(1, $item[spaghetti breakfast])
to this:
if (available_amount($item[spaghetti breakfast])>0) { eat(1, $item[spaghetti breakfast]); }
You'll need to do it twice for SCstd and thrice for HCStd, and unless you edit in something else, remember to fill up (to make use of your...