Either with an inline join:
let SelectORJoin = if(i=1, 'SQL SELECT', 'JOIN (Table1) SELECT');
Or with an if structure like VBA:
if i = 1 then
let SelectORJoin = 'SQL SELECT';
let SelectORJoin = 'JOIN (Table1) SELECT';
Note that semi colons are not required on the end of the construct lines, the one at the end of your next statement is also superfluous.
Hope that helps,