Encontré la solución!! El problema está en la siguiente línea!
document.write (redondear(<%= variables.get("cantidad1_1") %>*<%= variables.get("prec1_1") %>) + ' €');
Cambiarlo por:
document.write (<%= variables.get("cantidad1_1") %>*<%= variables.get("prec1_1") %> + ' €');
Y esto:
if (<%= Double.parseDouble(variables.get("cantidad1_2").to String())%> != 0 )
Por esto vale:
if (<%= variables.get("cantidad1_1")%> != 0 )