Here is a script I used to calculate based on an SO lines UDF, on the Column post validate event for the UDF_CWT_PRICE column, which sets the UnitPrice field:
retVal = 0
'retVal = oSession.AsObject(oSession.UI).MessageBox(""got here"")
retVal = oBusObj.GetValue(""UDF_ITEM_WEIGHT$"",strWeight)
dblWeight = 0
CWT_Price = 0
dblPrice = 0
retVal = oBusObj.GetValue(""UDF_CWT_PRICE"", CWT_Price)
If IsNumeric(strWeight) then
dblWeight = Cdbl(strWeight)
If dblWeight <> 0 then
dblPrice = (CWT_Price * dblWeight)/100
End if
End if
retVal = oBusObj.SetValue(""UnitPrice"",dblPrice)