A which-do-you-mean question won’t be of any use unless there is some word in each of the names of the objects that can serve to distinguish it from the others. Suppose you enter the command X SWORD and the parser answers ”Which do you mean, your sword, Bob’s sword or the sword?” There will still be no way for the player to choose the sword called simply “sword” (since the two other swords are also partly called “sword”). You need to give the last sword a name that allows Inform to distinguish it from any other sword.
In the case you give code for:
–you actually already give the three swords distinct internal names (“Sword1”, “Sword2”, and “Sword3”). The simple way out then would be give them distinct names that the player is allowed to use.
I understand that this is not the kind of answer you want, but it would be playing along with the way Inform 7 already works – and why not?
Well, supposing you have a good reason for why not – I once wrote some code that makes Inform understand Printed Names (and the printed names of things can of course perfectly easily be changed dynamically). You’ll find it here: <[url]comparing text substitutions - #6 by Felix_Larsson]>.
Be warned, though, that this way of doing it (and it was the only way I could come up with) comes at a performance cost that can be quite noticeable, at least if the names of things are long.