Okay i think i got an alternative.
Run this on init.sqf for server or initPlayerLocal.sqf for non-server.
nul = [] spawn {waitUntil {!alive player}; waitUntil {alive player}; waitUntil {!alive player}; waitUntil {alive player}; CODE HERE};
Should wait until menu shows up, waits until player spawns, wait until player dies, wait until player respawned then execute spectator script. It is local by the way so it won't affect other players. PS: You don't need to use spawn command, but i recommend it so the whole script doesn't hang.