Multiple questions, butTo safely release the simplest way is this:goblin where you want it.
Build the cage.
To do so use, using build, caje, expand (to show all cages and their contents), and build the cage where you want it.
You can then connect a lever to the cage (query the lever, add a task to connect to the cage, and use that to release the caged creature (goblin or otherwise) by pulling the lever (add a task to Pull).
You can also use the take from stockpile command to move them to another stockpile.