Currently the only way to toggle the configuration of a widget is by clicking on the pen icon.
There is the 'configuring' reserved parameter, but this appears to be read only. If this can be made so that the dashboard listens for a change, it would be possible to change the widget configuration state via expressions/scripting.
For IA Ref, Support ticket #14948 has further information.