This is what I was going to suggest, and I agree that Paradox Factor is a terrific example of gameplay similar to what you describe. If you want people to keep playing with variations until they reach a satisfactory ending, don’t use the *ending command until they get there…
As for how to view the source code, scroll down to the bottom of this thread for the latest advice: