This is how i disable/enable everything for one of my tools, it works for me as i recall made things faster:
def disable_all_panControl(self, enabled=True ):
"""
Disable or Enable all modelPanel controls.
"""
all_mp= cmds.getPanel(allPanels= True) # disable all panels, the hypershade ball panel was problematic
for p in all_mp:
if p != "scriptEditorPanel1": # skip scripteditor in case of errors.
try:
cmds.control(p, edit=True, visible= enabled, en= enabled)
except:continue