Não faz sentido aquele return e também está faltando um end no final.
addCommandHandler ("setlevel", function (thePlayer, cmd, jogador, level)
local theJogador = getPlayerFromName (jogador)
if (not theJogador) or (not level) then return end
if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup ("Console"))) then
setElementData (theJogador, "Level", tonumber(level))
outputChatBox ("Level setado no jogador com sucesso.", thePlayer)
end
end)