I believe I found the issue. The following was duplicated in the template
#Embed(%CustomValidateEnd,'After Validate New Value'),%FormID,TREE('Routines|'&%TabHeading&' Tab|'&%FormID&' Field|Validate::'&%FormId&' Routine|5 Add Server Side Code Here')
I commented it out and now the generated code does not duplicate now.
Ken Watts