I don’t know if scripting will help you with this. You may need or want to consider the “isfulfillable” setting on items and/or the non-inventory item type, if you need to invoice against items you don’t ship.
If an item is not fulfillable it immediately becomes available for billing (invoicing), but items that NetSuite expects you to ship you need to ship them before billing.
Pending Approval > Pending Fulfillment > Pending Billing > Billed