this should be in requests learn how to do it yourself. you literally just explained how to make the skript.
step 1: check if the player is right clicking
step 2: check if the item is the vault item (do not use names as the indentifier, please use nbts which requires skbee i learned from some of shanebee's very great articles on the skbee wiki
https://github.com/ShaneBeee/SkBee/wiki)
step 3: remove the enderchest
step 4: give him a player vault (i have zero idea what you mean by player vault but below here is a way to make what i think you're talking about)
How to make a player vault
step 1: make a command that opens a gui
step 2: check if the player is putting something in the gui
step 3: if so save that item under a variable like {slot1::%player's uuid%}
step 4: check if the player removing something from the gui
step 5: if so set the var to nothing
step 6: the next time a player opens that gui set slot 1 of the gui to the item saved to the variable so the player can grab it whenever they want
u happy? this is basically spoonfeeding