I just have sent my mail, as an improvement occurs to me. Instead of
testing the whole grammar you could write a special production to test
for the version only. For your original example this would look like:

SKIP? "set" "disk" would recognize the text up to "set disk"
SKIP "interface" would recognize the text up to "interface" and
set xiVersion to 2
SKIP "map" would recognize the text up to "map" and set
xiVersion to 3

If "set", "interface" or "map" can occur in later positions of the
script too, this production has to be refined.
"GetVersion" is called as a sub-parser in the main parser as follows:

by the parameter "xState.str(-2)" you pass the whole text of your
script to the sub-parser. This parameter is not in the definition of
GetVersion. When GetVersion ist called with an additional first string
parameter from the interpreter, an overloaded version of this production
is executed as sub-parser.

I didn't test the code above, but it should work. If you like, you can
try it