I need to create some LUA that changes state based on which character is alive. Sort of a jump list of names so that is X is alive then macros should refer to X but if X is dead then go to Y. If Y is dead then so on ans so forth.

Why would you need to use LUA to use your main characters name? Can you not just /assist Main and then /cast?

Is there less latency involved with the LUA code? Sometimes I need to spam /assist multiple times to make sure it gets the /assist off.

That might be a better way to do things.