In this case, the issue comes from the fact that you’ve defined “pair of handcuffs” as a kind of thing rather than an individual thing. This shouldn’t create a problem with “After wearing the pair of handcuffs”; Inform treats “the” just like “a” in this context, so this rule will apply after the player wears any pair of handcuffs.
But when you write “now the pair of handcuffs is locked,” Inform doesn’t know which pair of handcuffs you mean! It’s obvious to any English-speaking reader that you mean the pair of handcuffs you just wore, but Inform can’t figure that out. If you use the rule of thumb I mentioned last paragraph–Inform will always treat “the [kind]” as “a [kind]”–you can see that “now a pair of handcuffs in locked” is too vague for Inform to figure out which handcuffs are meant.
There are two solutions here. One is to give the pair of handcuffs a temporary name in the rule:
After wearing a pair of handcuffs (called the restraints):
Now the restraints is locked.
Another way to do it is that the thing that is involved in the action (or first thing involved in the action, if there are two) is called “the noun.” So you can refer to it that way:
After wearing a pair of handcuffs:
Now the noun is locked.
Now if you test this out, you’ll find that you need to write a message to go with this rule (because “after” rules cut off action processing and stop the report rules from running) and that you need to write a rule to make sure the player can’t take off handcuffs when they’re locked, and probably can’t do other stuff too! But first things first.
By the way, if you want to put in code with indentation and stuff, instead of using the quote tool you can use the code tool, which is the button that looks like </>. You can also type three backticks ``` on separate lines before and after your code.