This code looks fine. The only issue is that you're sending "data" in as an argument and as a member variable (there will be a warning about this in the console): remove the var data = openlevs
line.
You just need to call your methods. Let's say you want to save when you press F5 and load when the game starts.
Loading
func _ready():
openlevs = load_val()
Saving
Go to project --> project settings --> input map (tab)
Enter savelevel_ into "action field", click add. Find "save_level" at the bottom of list, click "+", then "key" and press F5.
func _input(event):
if event.is_action_pressed("save_level"):
save_val(openlevs)