How to disable and enable things by script?

I did that here. Just change the binding to adapt it:

Maybe its bit of an overkill for your problem.