as Rilgamon already said you need to watch for the event "ADDON_LOADED" and check if it was your addon loaded, before the saved variables are ready.
Code:
function events:PLAYER_LOGIN(...)
22
23 if event == "PLAYER_LOGIN" then
and that will be always false because the variable event isnt declared