I'm not quite sure if I understood you correctly, but I think you are talking about problems with a multithreaded environment.
As far as I know MTA handles the scripting part in one single thread. Therefore it would be (for the server):
Global Var x = 2
Client A triggers the event.
Client B triggers the event.
Server Recognizes the Event of Client A
Function is executed
x is now 1
Server Recognizes the Event of Client B
Function is executed
x is now 0