Use a global variable as some kind of mode switch, for example have a variable 'buildmode' set to 0 by default.
When you select a turret it goes into build mode, so you set buildmode variable to 1. Then you adjust the initial selecting a turret logic to have a condition only if buildmode=0. This locks out any future clicking on turrets while you are holding one on the mouse.
Then to place the turret in the level you add to your turret placing logic a condition buildmode=1. This means it will stamp a turret and remove the follow mouse logic only if buildmode=1, and then once stamped you set buildmode back to 0.
In short, you will only be able to select a turret to follow the mouse if buildmode=0 and you will only be able to stamp a turret down if buildmode=1.