It is not uncommon to want a scene to occur only once; fortunately, we can easily make this work by adding the condition "if ...whatever scene... has not happened" to the begins when... rule. For instance, the following will make Confrontation happen just the one time:
"Exit Strategy"
Airport Gate is a room. "Stream-lined and sterile, like airport gates in almost any country -- or at least, in any country to which you can legally fly. The mass of people is moving slowly and with muttering toward the Customs Area to the north."
The Customs Area is north of the Airport Gate. The guard is a man in Customs Area. "A guard in grey fatiques watches the passing crowds, selecting people to inspect."
Confrontation is a scene. Confrontation begins when Confrontation has not happened and the player is in the Customs Area. Confrontation ends when the guard carries the bag.
It is particularly important that we make this scene happen once only, because it is otherwise possible to get the game stuck in a loop: when the player is in the Customs Area and the guard carries the bag, the conditions for both ending and beginning the scene are fulfilled. Without the "has not happened" condition, the scene will then end and begin, end and begin, over and over, until the game halts with the error message ">--> The scene change machinery is stuck."
If we find that we are getting this error message and cannot figure out what is wrong, it is usually a good idea to type SCENES to turn on scene debugging, then run through the steps that cause the error condition. When it is clear what set of scenes is firing, a glance at their starting and ending conditions may reveal the nature of the problem.
The rest is largely window-dressing, but will help us see when scenes start and end.
When Confrontation begins:
say "'Ma'am,' says the guard to you at once. 'I'm going to have to ask to see your luggage.'
'Luggage' seems an awfully fancy name for your little bag, but he looks determined."
Every turn during Confrontation: if the guard is visible, say "The guard waits, tapping his foot."
Before going south during Confrontation:
say "You retreat toward the gate -- a cowardly maneuver. You're going to have to go past him sooner or later."
When Confrontation ends:
say "The guard begins pawing through your bag, muttering to himself in a language you don't recognize."
The player carries a bag. The bag contains three postcards, a candy bar, and a smuggled fetish doll.
Instead of giving the bag to the guard:
now the guard carries the bag;
say "The guard accepts the bag carefully."
Test me with "north / s / n / give bag to guard".