well.. you're doing things wrong here.
first of all - use function to execute a behaviour (shooting).
2nd of all - use trigger of some kind. (currently i'm not on my pc so i can't check) but LOS should be usefull here. "Has LOS to object"
then you call function to shoot.
activating / deactivating groups is just misused in this case.
oh yeah, and you will need timer or your enemy will shoot indefinitely while in range. (unless you want that)