I guess you'd like to check if current points are higher than the localstorage value, if not set global variable to localstorage.itemvalue, if so set the localstorage to the global variable..
Right now you are only setting the localstorage if it doesn't exist yet..