Fix a showstopper where double-clicking does not bring up CBN

Part of the double-click handling codes in StateMachine class has gone missing during a recent merge from ChocoButterUI branch. This commit restores the codes as they should be from ChocoButterUI, and therefore fixes the following defect:

http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-978