Instead of use a command, you should use something like a function for it so it can't be executed unless it is from the GUI. Could you show me the command?
Player is holding a diamond helmet:
Open chest with 3 rows named "&aEnchant din &3Hjelm" to player
Wait 3 ticks
Format slot 0 of player with light blue glass pane named " " to be unstealable
Format slot 1 of player with white glass pane named " " to be unstealable
Format slot 2 of player with light blue glass pane named " " to be unstealable
Format slot 3 of player with white glass pane named " " to be unstealable
Format slot 4 of player with light blue glass pane named " " to be unstealable
Format slot 5 of player with white glass pane named " " to be unstealable
Format slot 6 of player with light blue glass pane named " " to be unstealable
Format slot 7 of player with white glass pane named " " to be unstealable
Format slot 8 of player with light blue glass pane named " " to be unstealable
Format slot 9 of player with white glass pane named " " to be unstealable
Format slot 10 of player with light blue glass pane named " " to be unstealable
Format slot 11 of player with white glass pane named " " to be unstealable
Format slot 12 of player with shiny diamond helmet named "&3Hunger God" with lore "&aKlik her for at enchant din hjelm med &3Hunger God || &c$500 || &3Hunger God &a= &7Giver dig fuld &aMad permanent || &7når du har hjelmen på" to close then run [ execute player command "/EnchantHungergod"]
Format slot 13 of player with white glass pane named " " to be unstealable
Format slot 14 of player with shiny Diamond helmet named "&3Unbreakable" with lore "&aKlik her for at enchant din hjelm med &3Unbreakable || &c$1000 || &3Unbreakable &a= &7Gør så dit armor ikke kan gå i stykker." to close then run [ execute player command "/enchantUnbreakable"]
Format slot 15 of player with white glass pane named " " to be unstealable
Format slot 16 of player with light blue glass pane named " " to be unstealable
Format slot 17 of player with white glass pane named " " to be unstealable
Format slot 18 of player with light blue glass pane named " " to be unstealable
Format slot 19 of player with white glass pane named " " to be unstealable
Format slot 20 of player with light blue glass pane named " " to be unstealable
Format slot 21 of player with white glass pane named " " to be unstealable
Format slot 22 of player with light blue glass pane named " " to be unstealable
Format slot 23 of player with white glass pane named " " to be unstealable
Format slot 24 of player with light blue glass pane named " " to be unstealable
Format slot 25 of player with white glass pane named " " to be unstealable
Format slot 26 of player with light blue glass pane named " " to be unstealable
Its Danish, but i think you get the point.