That's the strange part Talvieno, I did define a burrow and then I went into the military screen and activated the alert. I had tested it once before when a were-creature attacked and they all obeyed it perfectly, DESPITE the pasture animals being scattered to the four winds. But when the siege arrived, they wouldn't listen. I don't think I changed it in the meantime, not on purpose anyway.
Hrm... I've never seen an instance where they wouldn't rush to their alert burrows when it was activated.
I doubt it's a bug, because if it was, someone would've noticed it before, surely. You might check again. It's very easy to accidentally delete a burrows. I can't remember off the top of my head which key does it, but it doesn't ask you to confirm - it simply deletes it instantly. That would cause your alert to stop working and give you the behavior you saw.
EDIT:
I thought about building a barn, as I'd just completed an archery tower, but I ran out of time before the siege. Other than breaching the caverns so cave moss will grow, is there another way to feed the animals underground?
Not yet. If I understand correctly, though, Toady is going to be implementing hay very, very soon (possibly the next release). After that, you might simply have your dwarves harvest hay, bring it belowground, and have the animals feed to their hearts' content.
REEDIT:
Also we can roof over the pasture, doesn't the grass need sunlight to grow?
I don't think so. If a tile is marked as sunlit, it remains permanently sunlit, if I remember right. You can actually keep your dwarves from getting nauseous in sunlight by exposing the whole of your dining hall to the sunlight just once. Even if you floor it back over, it's always sunny inside.