Try this:
command /shop:
trigger:
open virtual chest inventory with size 2 named "Special Shop" to player
format gui slot 0 of player with emerald named "&a&lDeath to all mobs" with lore "&aUNCOMMON" to run:
open virtual chest inventory with size 2 named "Special Shop" to player
format gui slot 0 of player with emerald named "&6&lEmerald Key" with lore "&6LEGENDARY" to run:\
if player's inventory contains 500 diamonds:
remove 500 diamond from player's inventory
give player emerald named "&6&lEmerald Key" with lore "&6LEGENDARY"
else:
send "(Message Here)"
format gui slot 1 of player with name tag named "&6Free Warden helmet" with lore "&6LEGENDARY" to run:
kill player
broadcast "&cDon't be greedy %player%, they were trying to scam the the shop out of warden helmets!!!"