Interact with a live running game through the use of plugins

I was working on a live reload plugin recently but, came across an issue which prevented the plugin from actually reloading scripts; the problem was that I couldn’t disable and enable a script in a live game environment through the use of plugins and, I was wondering whether there’s any work around or possible solution(s).

One solution I’ve tried is through the use of _G, a table is stored in _G with a function which would use getfenv() to get the script environment of the script which called it and, it would disable and enable the script using the environment retrieved from getfenv(); unfortunately, this didn’t work and, indexing _G in a live game environment just returned nil.