@marvineer You don't really need to test for each one, just test for one of them and groupe then creation/setting together...
if !exists(global.global1)
global global1 = {1, 2, 3}
global global2 = {3, 4, 5}
global global3 = "whatever"
else
set global.global1 = {1, 2, 3}
set global.global2 = {3, 4, 5}
set global.global3 = "whatever"
Also if these globals are in effect constants (so nothing anywhere else changes the value), then there is no need to set the value if the global(s) already exist.