If you just dump a room in, the ceiling of that room will keep falling and crush the dwarves underneath it.
A safe, but very time-consuming method would be to dump in (by using cave-ins) one "layer" at a time until it's a column the length and width you want, but the height goes all the way to the top. Then dig out the room you want and somehow collapse in the sides of the part you don't want.
Certain details would have to be worked out, but you'll need an obsidian factory unless the top of your magma pipe is has more than half the terrain levels of the map above it, which I believe is not possible.
---
Alternatively, you can try draining the magma from the very bottom obscenely fast to not only drain the magma from the entire pipe, but from the "magma flow" as well. This is probably not possible. But if it is possible and you manage it, you can build the room down at the bottom, and when you're finished, let the magma pipe refill around and above it.
Or you can combine these so you don't have to dump as many layers: drain out most of the pipe, then drop in layers from near the bottom. It's not hard at all to drain a magma pipe faster than it fills. Five to seven pumps should be overkill. I know for a fact that ten will do it, because I did it myself back when I vastly overestimated the rate that magma pipes refill.