Script to swap current opacity value with an alternative value

Here a little script to show a dialog to swap the current Opacity parameter with an alternative value:

image

The first time the script is executed, the dialog will appear, the second time it’s executed the opacity values will be swapped:

image