Specifically in Lua, will I do any harm by doing this:
for i = 1, 10 do local foo = bar() -- do stuff with foo end
instead of this:
Go for the safest alternative, which is to use the smallest scope for all variables. As for efficiency, local variables are stored in a stack; no memory allocation is done inside the loop.