I think you have your answer but for what it's worth I had some issues trying to implement nested if statements, they worked in excel but not in the Survey.
I actually found it useful for my brain (and to get it working) to break the problem down into separate 'calculate' lines, calculate is a special field type that does not display on the form it works just like a variable and can be used in the other calculations e.g
type,name,label,calculation
1/ calculate,dia_diff,Diameter Difference,${sec_6_log_dia_meas_len}-${sec_6_log_dia_disp_len}
2/ note,sec_6_log_dia_diff,Measured Difference (mm),if(${dia_diff}<0,${dia_diff} * -1,${dia_diff})
3/ calculate,dia_diff_score_low,Diameter Score < 400,if(${sec_6_log_dia_disp_len}<400,if(${sec_6_log_dia_diff}>25,0,3),3)
4/ calculate,dia_diff_score_high,Diameter Score >= 400,if(${sec_6_log_dia_disp_len}>=400,if(${sec_6_log_dia_diff}>50,0,3),3)
5/ integer,sec_6_log_score,Log Score,min(${len_diff_score},${dia_diff_score_low},${dia_diff_score_high})
The logic is:
1/ Calculate the difference between what is measured and what the machine displays
2/ Convert the measurement to an absolute value (ABV)
3/ If the log has a diameter under 400mm and the difference in measurement is >25mm this log scores a 0
4/ If the log has a diameter over 400mm and the difference in measurement is >50mm this log scores a 0
5/ The log score is the minimum of Length Score,Small Diameter Score or Large Diameter Score
I left out the log length score calculations but they are similar to diameter
I have attached the full survey if anyone wants to take a look - I have trimmed out a lot of the lookup data.
Steve