I've found scope to be very difficult to figure out in GML when using script_execute, to be honest. For instance, what you did will work fine for windows/macos export, but if you export to HTML5, it will sometimes throw an error that it is unable to find your element.
It's generally just best practice to pass in all objects you use or reference for safety:
my_button = auto_button(/* data */);
my_button.set_click_func(function(_obj, _btn) {
_btn.color = c_white; // eg.
_obj.variable = 2; // eg.
}, [self, my_button]);