In Texis version 7 and later, Vortex compiler pragmas (here) can be pushed on and popped off of a stack, with the addition of the push or pop keyword. This allows a pragma to be used locally in a code block, preserving and restoring the previous value - even if unknown.
Also, in version 7 pragmas only affect the <script>
block
they are in; they are not inherited by following blocks or modules.