Is there some reason these are not pushed down into advanced-template.sql so they can be shared by other configs?
To avoid invalid operations, you can have separate statements that try math on a selected numeric column and that avoid math on a general @columntype column -- you can use " || 'X10'  " in place of " * 10 " for general @columntype.