Nie musisz zaśmiecać serwera grupą zmiennych skoro już zapisałeś arg 1 na slocie. Teraz wystarczy to odczytać.
command /cos [<text>]:
trigger:
set {_gui} to chest with 1 rows named "cos"
set slot 1 of {_gui} to stone named arg 1
open {_gui} to player
on inventory click:
event-inventory is not player's inventory
if name of event-inventory is "cos":
if clicked slot is 1:
send name of clicked slot to player
I skoro arg 1 zapisujesz jako typ danych text/string to jego pozniejsza zamiana nie jest konieczna
"arg-1%" -> arg-1
W twoim kodzie przez to wyskakują irytujące ostrzeżenia