Code:
if UnitLevel("player") == MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()] then
return
end
Just stick that at the top of the file. You don't need to wrap the rest of the file in an "else-end" block; "return" in the file-level scope stops execution of the rest of the file.