Needs the behaviour plugins 'pathfinder' and 'turret' - is it possible to link these?
Would say from the outset you should set your origin/imagepoint on the blue squares to 0,0 (Top left) and check when overlapping, their x/y positions in relation to the black square.
You can then check reliably if the turret is overlapping the tower, and also make it snap to a grid.
I'd suggest using an invisible sprite that's set to mouse x/y and testing it if's overlapping the tower or a turret, that way you can prevent turrets embedded in the tower.
Are you using
Assuming you're using a grid