Do not post twice the same question,
and also write well the topic tilte:
“Variables getting lost in the logging of script list” it’s incomprehensible,
changed to more adequate: “I’m unable to manually convert a script to an “add script” function”
Continue here, already replied:
http://forum.mikrotik.com/t/adding-scripts-in-reset-configuration-script/161443/3