I've not tried it but in theory you could change the for loop so that it goes from 5 to 1 in steps of -1.
for i = 5,1, -1 do
...
end
View the lua programming language for the 'for loop' to see what variety is available.
Here is a link to the lua faq from wowwiki site.
http://lua-users.org/wiki/LuaFaq