I'm working on at Tank type game myself and even if this scenario is not part of my current project, I decided to take your challenge!
I looked at your tank.capx and your starting with the wrong logic. Part of the answer is in your first post (I put it in Bold in the quote).
Hi everyone;
......problem I'm facing is when the turret is rotating and hits a wall or some kind of obstacle, the turret is keep moving and never stops! Any tip around?
Set angle towards mouse will not work, you need to have it rotate towards the mouse.
If you move the mouse very quickly with the set angle condition you will notice how it jerk's to the new angle, but if you tell it to rotate towards the mouse the turret simply change's direction and continues to rotate a the same speed no matter how fast you move your mouse.
Now to work on that obstacle problem.