Not quite sure what you're asking, but I'll try to answer what I think you're asking.
Set the delay to how long you want to wait before the event fires, then when it executes, teleport them out of the jail, and stop the event. Like so.
Code:
public final class JailEvent extends Event {
/**
* The sentence time, in milliseconds.
*/
public static final int JAIL_TIME = 300000;
/**
* Creates the JailEvent.
*/
public JailEvent() {
super(0);
}
@Override
public void execute() {
if(this.getDelay() == 0) {
this.setDelay(JAIL_TIME);
/*
* Teleport the player into the jail, and set anything
* (such as a 'jailed' boolean) here.
*/
} else {
/*
* Teleport the player out of the jail, and unset anything
* (such as a 'jailed' boolean) here.
*/
this.stop();
}
}
}