Assume the folling:
Your opponent casted a Spiked Pit in a zone (Spiked Pit does not trigger when air units enter the zone). Your gargoyle (flying unit) enters that zone - nothing happens. After entering, the gargoyle guards. Because of guarding the gargoyle looses his flying trait. Does the Spiked Pit trigger?
If the trap triggers, in the case of the gargoyle there is another complication:
Does the gargoyle gain the benefits from his guard marker against the trap? I.e. does he get +3 armor and -3 toughness? I assume he does, since he first gains the guard marker and as a consequence he loses flying which triggers the trap. This is an important question, since the +3 armor will lower the damage income siqnificantly and the tough -3 decreases the chance of the trap to stuck the gargoyle from 100% to 9/12.