You have an sclick listed twice.
on *:DIALOG:opcontrol:sclick:38:{ mode $active +I $did(2) } on *:DIALOG:opcontrol:sclick:38:{ mode $active -I $did(2) }
Second one should be 39 instead of 38.