Good first hack!
I'm going to break down what you have written and modify it a little. You should be able to test each line to make sure it does what you want before you roll the code back up into a multiline.
[died]
trigger=#*#You have entered Guild Lobby.#*#
command=/docommand /multiline ;
/if (!${Defined[bWaitingForRez]}) /declare bWaitingForRez int global 1 ;
/varset bWaitingForRez 1 ;
/timed 3000 /if (${bWaitingForRez}) /camp desktop
[rezzed]
trigger=#*#You regain some experience from resurrection.*#*
command=/docommand /multiline ;
/if (!${Defined[bWaitingForRez]}) /declare bWaitingForRez int global 0 ;
/varset bWaitingForRez 0
-------------------------------------------------------------------
The part you were missing is the "/timed" is a command, so at the end of the "died" section you are saying in 3000 x 0.1s execute the check to see if you are still waiting for a rez.