Run one-time script calling plugin functions

I would lean toward the approaches by babixeddu, Amit Sukapure, or tf from the question you referenced. As WordPress loads normally with those solutions you can use Core functions to manipulate data. In your case, you’d need plugin_dir_path()

In my case, I have a very simple plugin that creates an admin page with a single “execute” button on it. I hack in the code, upload the plugin, login, and click. That method prevents accidentally running the code multiple times. I can then remove the plugin.