to address the "keas flying up out of the marksdwarves' view cone" issue, i would put the towers a little way back from the stockpile, not right next to it. maybe 15-20 tiles away from the farther edge? (so, if your stockpile is 10 tiles wide, then put the tower 5-10 tiles from the near edge)
as stated already, the marksdwarves won't generally fire through fortifications unless they're right next to them (there are exceptions i'm glossing over). so to address this, build a second wall inside your tower, such that the path inside the fortifications is only one tile wide and they can't meander. you can build your staircases, ammo stockpiles, etc inside the inner room if the tower is wide enough, but a 7x7 exterior will get you a 5x5 patrol loop, a 3x3 inner wall, and a 1x1 staircase up the centre
dwarves obeying a "station" order will scatter randomly near the marked position, rather than standing precisely at it, so it's not very effective for archery towers. it's more effective to create a patrol route that circles the one-tile path next to the fortifications, and schedule 2-3 marksdwarves to patrol that route
i assume your goal is harvesting keas using gems as bait, rather than protecting your gems. if you just want to protect your gems, put them somewhere else