From what I understand, only one of your 4 first fields can hold a price of some sort and you want that number to be copied to the fifth field. Why not forget about complex scripting and just add all four fields? Since the others will be 0, the sum of the 4 fields will be the amount of the only field with a price in it!
Maybe I didn't get what you are trying to achieve?
Thank you, that worked! I'd still like to know what was wrong with the script, must be the way I wrote the last line, just not sure what the correct syntax is.
When you get the value of an empty field, the the result is an empty string. When you compare an empty string using the strict not equal operator (!==) to the number zero, the result is true and you set the result of the calculation to the empty string. If you were to use the != operator, the field value would be coerced to the number 0 if the field is blank. So
"" !== 0 is true
"" != 0 is false