Don't quote me on specific spells, I'm just the idea man. Here goes:
well it's a CR20 trap. That's pretty serious, meaning it has to be hard.
If a less than 5th level party went into the room, it would be sure defeat(the same as if they met a CR20 monster). So whatever happens, needs to be that tough.
As a CR20, it must have a pretty high Search DC, to help ensure the rogue doesn't see it. If the trap is mostly magical, that just makes sense anyway.
Since it is a rerouter, we could imagine that the owner wants to capture, not kill. On the other hand, any party that can teleport is pretty dangerous, and I know I'd kill them if I could with a squashing ceiling.
The room should have whatever spells it takes to prevent teleportation out, since that's how the party got in. An anti-magic field filling the room would work. Put a high ceiling in, have the shunt open up above the field (where it would work). The PCs fall 10 feet or so (taking 1d6 damage, tee hee) to the floor, and into the field. Work out the field size, and room height to make it all work. This would make an excellent means of detaining a party.
Of course, capturing the party on purpose violates my DMing code, so you need to make the escape available to counter this. Since this is a no-magic room, you'll need a no-magic exit, so the owner can extract the prisoners. Naturally, we'll have to expect the PCs to find this exit and use it to escape, but let's pretend the owner doesn't see that coming.
I'd put a hatch in the ceiling, wherein the owner can look in on his guests. He can also demand they put their gear in a basket (before he feeds them or lets them out). Then he can lower a rope ladder for the prisoners to climb out. That's the normal use...
I'd expect the PCs to try magic, and determine it doesn't work (in the lower half of the room). I'd expect them to search the walls for exits. I expect them to try climbing the walls (since it's a high ceiling room). Once they get up high enough, the hatch in the ceiling should be obvious to find. Make the hatch be of the iron bar variety if they have no climber (that way they can use a rope and grappel (or a dagger or something) to try and hook the hatch, so they can climb up and secure it better.
The walls smoothness should be based on the needs of the DM. If you've got a wall climber, make them fairly smooth. If the party couldn't climb out of bed, make them rough hewn. You can also make the walls angle in as they go upward (to thwart climbing (DC get's higher)).
I wouldn't make the trap heavily guarded, it's a fairly automated process, so who's going to get out? Just have it checked, as a regular point on the patrol.
Much of this trap is escapable for a rogue, not so much for other classes. That's kind of the point. Rogues exist to avoid and escape traps. But anybody else, should be hosed.
If the party figures out the extent of the magic field, they may figure out how to raise the wizard high enough where his spells work. Another viable solution could extend from there.