Scripting (maybe) / Paperless

Is it possible to have a batch print job, say Sales Order Printing, set to electronic delivery and then have it NOT deliver the document based on X Criteria?    IE, if the only item on the SO is an item that the customer doesn't need to see, how can I do this?   I'm fairly decent with scripting.  I need help with this one though.