Merged PR from João Barbosa: refactor: Avoid duplicate map lookup in ScriptToAsmStr