Sales Order Detail script bypass backordered quantity

I created this script for sales order detail lines that works if I key a number into the backordered quantity field but does not work if I tab past the field with no entry.

tmpQtyOrd = 0

tmpQtyBkOrd = 0

retVal = oBusObj.GetValue("QuantityOrdered",tmpQtyOrd)

retVal = oBusObj.GetValue("QuantityBackOrdered",tmpQtyBkOrd)

 

retVal = oBusObj.SetValue("UDF_TO_SHIP", tmpQtyOrd-tmpQtyBkOrd)

what do I need to add to the script?

thanks in advance