OK, marksdwarves are a little tricky.
Stationing Marksdwarves
If you give a marksdwarf squad a 'station' order, valid locations for them to path to are any square within 3-5 squares of the station order, on the same z level. Therefore, I recommend you build your fortifications a z level up from wherever you're likely to be firing at. Also make sure that you don't station a squad within 5 squares of an outside tile on that Z level, because that will tell the squad that those outside squares are valid station squares, and they'll run into the trap hallway.
Alternatively, you can ensure that your military dwarves stand in the correct place by making the valid squares a burrow, and tie that burrow to an order & alert. Then when you want a squad to go to that burrow, you activate that alert for that squad. Be careful that you have a good sense of how orders and alerts work first though, or your marksdwarves may run away because they think they're still civilians.
Quick response/not running outside in the middle of the fight
Sometimes dwarves are lazy and won't equip their equipment until they need it. After you make equipment changes to your squads, give them a station order during peacetime to get them to go grab what they need, so it's on them when they need it.
Bringing ammo
First, make sure that your dwarves all have quivers equipped, or at least that there are enough quivers for them all to equip one.
Second, make stacks of ammo available. Dwarves prefer stacks of ammo, they're a lot faster to pick up, and single ammo pieces get buggy. Also note, forbidden ammo is sometimes claimed, and will take up assigned-ammo space without being usable in combat. Try to avoid forbidding ammo - if you need to dispose of it, melt it, sell it or destroy it.
Third, never mix bowdwarves in a squad with marksdwarves. If you must have bowdwarves, create a separate squad for them. If you have mixed-ammo squads, they'll pick up each other's ammo and be unable to do friggin anything because they have the wrong type of ammo.
If ammo claiming has bugged out, try removing all ammo from all squads, waiting a few ticks, and then assigning it back again. It'll take them a little while to reclaim it, but they'll get around to it.
Fourth, if you have no hunters, make sure you don't have ammo assigned to them.