Purchase Order Lines Script not behaving as expected

SOLVED

We have a checkbox UDF in purchase order entry at the lines level called UDF_LINE_COMPLETED, when they check this box I would like to zero out the quantitybackordered field. I have tried this script as a column pre-validate and post-validiate on the UDF and it properly zeroes out the backordered quantity, the weird thing is that it will not allow the checkbox to be checked. You check the box, it fires the script off and after the script runs the box is unchecked again. I have confirmed this by grabbing the value of the checkbox before and after the script runs, it changes it from a Y to an N. Here is the script...

sLineCompleted = ""
sLineKey = ""
sItemCode = ""
sEditKey = ""
nValue = 0

retval = oBusObj.GetValue("UDF_LINE_COMPLETED$", sLineCompleted)
retVal = oScript.DebugPrint("Line Completed: "& sLineCompleted)

IF sLineCompleted = "Y" THEN

retval = oBusObj.GetValue("ItemCode$", sItemCode)
retVal = oScript.DebugPrint("Item Code: "& sItemCode)
retval = oBusObj.GetValue("LineKey$", sLineKey)
retVal = oScript.DebugPrint("Line Key: "& sLineKey)
sEditKey = oBusObj.GetEditKey(sLineKey)
retVal = oScript.DebugPrint("Edit Key: "& sEditKey)
retVal = oBusObj.EditLine(sEditKey)
retval = oBusObj.GetValue("QuantityBackordered", nQBO)
retVal = oScript.DebugPrint("Quantity Backorder Pre-Write: "& nQBO)
retVal = oBusObj.SetValue("QuantityBackordered", nValue)
retval = oBusObj.GetValue("QuantityBackordered", nQBO)
retVal = oScript.DebugPrint("Quantity Backorder Post-Write: "& nQBO)
END IF

I have tried setting the value of the checkbox to a Y at the end of the script but I get an unknown property error message. Not sure why it would be resetting the checkbox value but I am not terribly familiar with using the EditLine function so maybe I am just missing a step in that regard.

Any help is highly appreciated.

- Jonathan K.