Take a look at Message.delayEvent(), this function should provide anything you need. Just make sure that you delay the note-off for the function too or you might end up with stuck notes (if you play fast notes and delay the note on it might come after the undelayed note off and will ring forever).