You can type multiple commands on one line, but separated with full stops rather than commas.
You could just enter the pattern "hit nail with hammer", but that means it won't handle "hit
the nail with hammer", or "look at nail. hit it with the hammer" etc.
You just need to add a new command, enter the pattern "hit #object1# with #object2#" (so it will match anything the player types of that form, e.g. "hit nail with hammer", "hit myself with fish"), then add the script that you'd like to run. In that script, add an "if" expression "object1 = nail and object2 = hammer". "Then:" will be the script to run in this case, and "Else:" should print a message like "You can't do that".
Like this:
There are definitely ways that this could be made easier. Quest 5.0 was a complete rewrite of the system, so it's more like "New Quest 1.0" at the moment, so it will have a few rough edges.
How do you think the "hit X with Y" scenario could be made easier? One thought I have is to extend the current "verbs" system. It's easy to add "thump" as a verb to an object at the moment, so that mechanism would stay as a "one-object verb", then there would be a new way of adding a "two-object verb".
So you might edit the nail object, add a new "two-object verb" and type "hit" and "with". Then you would get an editor like the current "give" and "use" editor, where you could add "hammer" to the list of "other objects". What do you think?