X2_ITEM_EVENT_ACTIVATE is an integer constant. It only ever has one value, which cannot be altered ingame. Giving it a glance in the toolset, it looks like that value is set to be zero, so a check for whether X2_ITEM_EVENT_ACTIVATE is equal to literally anything other than zero is always going to be FALSE, and this particular condition will never be fulfilled.
What you want to do is to check whether the value that the function GetUserDefinedItemEventNumber() returns is equal to X2_ITEM_EVENT_ACTIVATE, e.g.:
if (GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ACTIVATE)