Rule collision? Simple Chat vs Final Question hacking

I have a problem now that seems to involve a conflict between my rules for Simple Chat and my rules for restarting the game. I suspect it’s another problem with turn order - perhaps “resume the story” doesn’t take effect until the end of the turn.

The code is a bit long…

[spoiler][code]Include Simple Chat by Mark Tilford. Use default forbid exiting conversations.

[We want to start the game off in conversation]

When play begins: Try talking to Ray.

[We’re going to be restarting the game, and we want to be in conversation when that happens too]

This is the reset the loop rule:
resume the story;
Try talking to Ray.

[create a “talk to” verb so we can get back into the conversation if we’re dumped out]

talking to is an action applying to one thing. Understand “talk to [someone]” as talking to.

Carry out talking to: run a conversation from chat1;

[this next rule is used elsewhere in the game - normally the turn would not be considered to be over until the conversation ended, so “end the story” would have no immediate effect. This Instead rule makes sure that the conversation ends right away so that the game can end.]

Instead of finding responses to when the story has ended (this is the exit conversation when the story is over rule): do nothing;

The exit conversation when the story is over rule is listed first in the instead rulebook.

[Here’s Zarf’s hack for allowing the player to have a “REPLAY” option that resumes the game in a particular non-initial state]

This is the zarf’s ask the final question rule: ask the final question replayably.

To ask the final question replayably: (-
print “^”;
while (true) {
if (resurrect_please) {

Zarf’s ask the final question rule is listed instead of the ask the final question rule in the shutdown rulebook.

Table of Final Question Options (continued)
final question wording only if victorious topic final response rule final response activity
“REPLAY” false “replay” reset the loop rule –

[and now the mundane things]

Infinite Loop is a room.

Ray is a man in Infinite Loop.

chat1 is a chat node.

Instead of giving text for chat1, say “We should do this again sometime.”;

Instead of finding responses to chat1, link to chat2;

chat2 is a chat node.

Instead of giving link to chat2, say “Yes, let’s do it again.”;

Instead of giving text for chat2:
say “Okay, we’ll do it again.”;
end the story;

[test me doesn’t work from within a conversation, so you’ll have to enter these commands yourself]

test me with “1/replay/talk to ray/1”

What happens is that the conversation ends the game, but when you REPLAY, the responses for the current chat node disappear, and you get dumped out of conversation. Then I enter “talk to ray” to show that the conversation is working again as expected. So it appears that the “exit conversation when the story is over” rule still applies, even after “resume the story” has been called earlier in the turn. How can I prevent that rule from running after a REPLAY?