After fighting with linking to levers and other silliness, i found a really easy way to do this.
Make two animal stockpiles, set one to only accept empty cages and the other to only accept filled cages. Right in the center of the filled cage stocpile channel out a hole in the floor. You can either put an "arena" on the floor below and keep your military there to kill prisoners, or channel down 15 z levels and kill them with fall damage. Either way, use i to set a "Pit/Pond" zone over the hole.
Once you've done that, wait until all your caged goblins are on the right stockpile, then go the the pit/pond zone with i and hit P, then have all your goblins dumped into the hole. A bunch of dwarves will come over, grab goblins, and drag them over and throw them in.
Few warnings for this method:
#1: Do not do this this way with thieves or wild animals. Both of these will ignore "prisoner" status and kill the dwarf that releases them and run off. You can instead station your military near the cages, THEN have them thrown in the pit, the dwarf will release them and your military will instantly jump on them before they can do any harm. This does not apply to animals that attack during a siege, whether they are trained, tame, or considered wild. As long as they have "Caged Prisoner" status, they will blindly follow your dwarves to the pit and get thrown in.
#2: Do not throw 50 goblins in with an inexperienced military, they will get overwhelmed and die even if you disarm them(d-b-d, mass dump the goblin cages, then exit that and hit k, and un-dump each cage. Bonus points if you go into the stocks screen and un-dump the goblins' armor, but leave the weapons dumped). It's fine for legendary warriors to kill armed goblins, but if you had those the goblins wouldn't be in your cage traps anyway, right?