I thought traps that "trapped" you were illegal, basicly like blocking your door in your house when someone was inside.
I have no idea! One I can remember was used was when someone ended up at the inside of our nether portal, they would then be trapped and be forced to kill themselves, so I suppose, it is not a deliberate trap, just was there to stop people getting in our base by not having their own nether portal.
We didn't specifically make traps that had people stuck, so I guess this is a different ball game to doing what you said.
If someone could shed some light on whether this is illegal, that would be great!