This won’t work. Inform has to check whether things are in scope in order to generate the action, so manipulating scope in action rules won’t work. If you’re trying to examine something in another Hallway room then you’ll fail with a “You can’t see any such thing” error before you get to this rule. You need to be modifying the scope with “After deciding the scope of the player” rules.
Anyhow, zarf’s advice to look at that section of the recipe book is good (especially “Rock Garden” and “Stately Gardens” if you’re ambitious; I’d also look at the section on windows), but the way to do this is to place rooms in scope. This will automatically make the things inside the rooms visible, meaning that examining them can succeed (as can doing any other action defined as applying to a visible thing), but attempting to take them will fail. I don’t see any reason not to use scope here, as it does exactly what you want! An example:
[code]“Long Corridor” by Matt Weiner
Long Corridor is a region. Western Corridor is in Long Corridor. Central Corridor is east of Western Corridor. It is in Long Corridor. Eastern Corridor is east of Central Corridor. It is in Long Corridor. Chamber is east of Eastern Corridor.
After deciding the scope of the player in Long Corridor:
repeat with area running through rooms in Long Corridor:
place area in scope.
Definition: a thing is corridor-bound if it is in Long Corridor and it is not the player.
After looking in Long Corridor when a corridor-bound thing is not in the location:
repeat with item running through corridor-bound things that are not in the location:
say “To [the best route from the location to the location of the item] you can see [an item].”
A flowerpot is in Eastern Corridor. An acacia is in Western Corridor. A ficus is in chamber.
test me with “x flowerpot/x acacia/take flowerpot/take acacia/drop it/e/e/x flowerpot/x acacia/take flowerpot/drop it/take acacia/x ficus/e/x acacia”.[/code]
The messages you get when trying to take something in another part of the corridor are icky. The best hook for that is a “Rule for reaching inside,” probably:
Rule for reaching inside a room in Long Corridor that is not the location: say "You're not close enough to touch that."; deny access.
Access would be denied anyway; what “deny access” does is stops the normal rule from reaching inside from running, thus suppressing the “You can’t reach into…” message that normally gets printed.
Anyway, this is just a sketch, but hope it helps.