If would try using $modx->setOption('key', 'value'). That's supposed to make a temporary change to settings that only persists during the current request.
Since system, context, and user settings are all merged into a single array by the time they reach your code, that should override anything else that's been done.
FYI, when it comes to settings, user settings override context settings, which override system settings.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODx info for everyone:
http://bobsguides.com/modx.html