Does this "defined event" actually have any legal status? How long can it take until the defined event occurs? It's possible that this is an intentionally murky area of the law (i.e., a judge can decide that preventing a person from leaving for an hour in case X is okay but 1 minute in case Y is not). Even so, it seems like if there's a person in front of you with legal authority to let you out of a secured area and you are asking them to let you out, then either they have to let you out or you are being detained.