I guess maybe you will need a variable on the tower too, like a bool isSelected.
1. On tower clicked, if globalvar=0, set globalvar=1 and set tower isSelected true.
2. If tower isSelected : set tower position to mouse.x,mouse.y
3. On mouse clicked, if globalvar=1, set tower isSelected false, set tower to position mouse.x,mouse.y, set globalvar = 0