trouble with "immediately undo rule"

I can’t seem to get the “immediately undo rule” to work for me. Here’s my sample:

Room1 is a room. "This is room 1.".
Room2 is west of Room1. "This is room 2.".

player is in Room1.

newundoing is an action out of world.
understand "newundo" as newundoing.

carry out newundoing:
	follow the immediately undo rule.

“undo” behaves normally. “newundo” only pretends that it did something:

Room1
This is room 1.

>w

Room2
This is room 2.

>undo
Room1
[Previous turn undone.]

>w

Room2
This is room 2.

>newundo
Room2
[Previous turn undone.]

>newundo
Room2
[Previous turn undone.]

>newundo
Room2
[Previous turn undone.]

Am I using the rule incorrectly?

I believe the problem is that it creates the undo state right before parsing and executing the action, so when you jump back to that undo state, you’ve only undone the action of newundoing. This is why UNDO isn’t an action normally (like AGAIN and OOPS, it happens outside of the action machinery).

Is there a way to make it behave the way one would expect?

I don’t think you can get any additional control over UNDO without extensions that tap it at the I6 level.

If you’re using Inform 10.1 the one to use would be Nathanael Nerode’s Undo Output Control:

-Wade

Yeah, you’re going to need to tap into the parser code, which practically speaking means I6.