Rackspace Octave Transpose script

It was the one posted by Schamass Octave-transpose with radio buttons

You had made mention of coding optimatimations Eric could make but not being knowledgable in the scripting language I tried the one he posted w/o alteration.
The errors started on the first line of it though so I didn’t get very far.
What I would like like is something that only needs to transpose up or down one octave on the press of a button or pedal and return to the untransposed state for the SWAM (audio modeling.com) instruments. if possible.

Is there a non scripted way of achieving this?
Curt