Well, there’s a couple issues going on. The big one is that the sentence before “if leader is attacked” ends with a period, not a semi-colon, which signals to Inform that that code chunk has ended. Therefore, it doesn’t know what to do with the line beginning with “if leader is attacked”.
Your friend is also going to run into problems because the instead rule written is going to prevent any of the check/carry out rules for attack from firing. It also seems to be missing a colon on after “if the noun is leader” and a semi-colon or period after “leader is now attacked”. If fact, there’s all kinds of missing punctuation. Basically, every line end needs either a semi-colon or a period. The last line in a code block gets a period; the rest should get semi-colons.
Rules from different rulebooks can’t be combined; “After waiting” should not be under “Check attacking”, because those things will never happen simultaneously (and Inform doesn’t know how to handle it.)
Here’s a working example. I’ve put all the attack code relevant for the leader in one “instead of attacking the leader” block. This completely bypasses the rest of the attack rules, so if you decide in the future that the player can’t attack unless she’s carrying the Vorpel Blade of Gore, you’ll have to do some revisions.
It looked to me like you wanted the death sequence to happen as the player waited, but as noted in the comments, it could just as easily go every turn. (Right now, the player character can open things, try on tiaras, talk to their friends, etc. without the fight progressing.)
There’s some pretty specific grammar for declaring things in Inform; “now leader is attacked” is necessary rather than “the leader is now attacked”.
I put in a “encounter count”, which is similar to the waiting tag that was being used earlier. However, that would have fired if the player had waited anywhere any earlier in the game, even if the leader wasn’t present. This is more specific, and resets itself if the player leaves the room and returns. (I’m pretty sure this should work, but I am using 6E72 rather than the most recent version.)
Is your friend compiling/testing every line or two? I still find that massively worthwhile; it seems time consuming, until you have to find the one hidden bug in twenty lines of code, which is much harder than it has any right to be.
A person can be attacked or not-attacked.
Understand “kill leader/use saber on leader/throw saber at leader” as “[attack leader]”
Instead of attacking the Leader:
if the Leader is not-attacked:
if the player is carrying the broadsword:
say “Your blade meets the man’s with a ring and a sickening squeal as the iron grinds together. He’s huge, nearly a foot taller than
you, and after a valiant effort on your part he forces the blade from your grip. It thuds to the ground where he kicks it out of your
reach before you can make a grab for it. You always try to tell Bernhard that a dagger was more your style but he never listens.”;
move the broadsword to the location;
say “You swing gamely at the man with your fist, and dodge back with a curse as he raises his blade, grinning.”;
now Leader is attacked;
say “This fight is clearly over, and you are not the victor.”;
Check waiting: [This could be replaced by “Every turn” if you like; right now it fires only if the player is actively waiting.]
if the encounter count is 1:
say “The man in the black tunic is squaring off with you. It occurs to you that now would be the time to use your saber. After all, the CB didn’t ask you to save lives.” instead;
otherwise if the encounter count is 2:
say “The man raises his battleaxe and charges you. You notice…” instead;
otherwise if the encounter count is 3:
say “The thieves[’] leader brings his axe in for a swift blow; you have just enough time to admire his technique before it slices through your chest.”;
end the game in death;
Every turn: [Likewise, this could be a “check waiting” or “after waiting” rule - it all depends how you want it]
if the Leader is in the location:
increase encounter count by 1;
now encounter count is 0;
The Sparring Room is a room. The player is carrying a broadsword.
The leader of the thieves is a man in the Sparring Room.
Encounter count is a number that varies. Encounter count is 0.[/code]