…what Draconis said, but longer…
The dropping action has an object called the hole dropped into (matched as "into").
This would be something that could only work for the dropping action as is–the one you get with “DROP SWORD.” (If you were doing something like this, you’d need a "setting action variables for dropping " rule to set the action variable “hole dropped into” to something. But you wouldn’t be able to winkle it out of the player’s command because, well, it doesn’t work that way. To give you an example of how it does work, when the player types “GO NORTH,” the action is going north, and then the setting action variables for going rules set the room gone from to the room that the player is in, and the room gone to to the room north of the player if there is one.)
deep breath Anyway, the solution is a lot simpler! The command “DROP SWORD INTO HOLE” maps into the “inserting it into” action. If you try inserting something into a non-container, it gets blocked by the “can’t insert into what’s not a container” rule, which is a check inserting rule. But Instead rules run before check rules, so you can just take care of this with an Instead rule:
[code]The Surface is a room.
The sinkhole is an open unopenable door. The sinkhole is down from the surface and up from the Underworld.
The player carries a sword.
Instead of inserting something into the sinkhole when the location is the Surface:
say “[The noun] plunges out of sight.”;
now the noun is in the Underworld.
Instead of inserting something into the sinkhole when the location is the Underworld:
say “You can’t get that up to the surface without climbing up there yourself.”[/code]
This also catches “put sword into sinkhole,” which is good.
(If you wanted, you could define a new “dropping it into” action and do some work to redefine “drop [something] into [something]” to get to that action, and then I think your rules would work, because Before rules also run before Check rules–except you need to add “instead” or “stop the action” to your Check rule, because the one you’ve got would let the action continue; and you’d also want to add “rule succeeds” to the Before rule, so it doesn’t go on to try processing the action normally. Probably if you did it that way you’d want to have a Carry Out rule that moves the dropped object and a Report rule that prints the message, with Check rules to make sure that the second noun was a hole, that you’re on the top side of the hole, etc. But it’s a lot simpler to hook on to the existing inserting it into action, especially because having DROP SWORD INTO SINKHOLE work when PUT SWORD IN SINKHOLE doesn’t is the kind of guess-the-syntax puzzle that angers people up.)