on turret behavior you have line of sight also i think... if you dont you can calculate the distance... so you can do this by using 1 true condition and 1 inversed...
True check condition : if distance(enemy.x,enemy.y,turet.x,turet.y)< turret.range Action. turet.setanimation to fire... play animation from beginning... loop animation... you dont need to set the loop animation since you can switch in animation editor.. to repeat and leave the repeat count on 1 will do endless animation repeat..
then copy paste it and select inverse on it or add Else under that condition and set animation to idle /or patrolling what you have
also i wold remove the spit and wait action call cause it will delay all other events also... not only the spit destroy action
remove spit destroy and wait... and add on sprite spit the behavior fade out and set the time to fade in 0 fade out 0 wait time 1 destroy after fade out.. or add a condition since its a bullet.. you can use the expression distance traveled... and the condition for spit sprite will be something like : spit.bullet.distancetravelled> 200 Action Spit.Destroy
also you can right click on the spit bullet condition check and make it an OR condition then add on collision with walls OR on collision with enemys ( the 200 above is the distance in pixel per tick )