How to make partial order shipments with lot numbers using BOI

I posted another question some time ago regarding the creation of shipments using BOI, as can be seen here:

http://sagecity.na.sage.com/support_communities/sage100_erp/f/100/p/101987/284231#284231

I got this solution to work wonderfully, however I've just been informed that the requirements have changed. The previous solution was using the ShipRemaining() method to ship all line item quantities, but now I need to support partial shipments for varying quantities of different items, including items with lot/serial numbers. Verifying the line quantities is rather easy by accessing the QUANTITYORDERED and QUANTITYSHIPPED values in the SO detail table, but I am having difficulty figuring out how to set the item codes and quantities on a line-by-line basis instead of relying on a single ShipRemaining() call. I am also completely lost on how to select lot/serial numbers when setting quantities for the shipment.

I've been taking a look at the MAS90 reference files, but they have unsurprisingly been of little help for this. Could someone please assist me with these changes? (Perhaps @ who managed to help me with the previous solution.)

Thanks in advance.