That's basically how I do that, but instead of using a global variable, I use an instance variable BOOLEAN typed.
on left click on sprite : selected to True
[NOT] left mouse down : selected to False
if selected : follow the mouse
Also I add an offset calculation to avoid the sprite to snap on the mouse position. For that I use 2 instance variable xOffset and yOffset
on left click on sprite :
Sprite selected = True
Sprite xOffset = self.X - Mouse.X
Sprite yOffset = self.Y - Mouse.Y
if [NOT] left mouse down : selected to False
if selected :
set X to Mouse.X+self.xOffset
set Y to Mouse.Y+self.yOffset
Oh and my way works with multiple instances, yours don't.
Cheers too o/
Oh and... The title of your topic has nothing to do with what you asked