The current sf2 format doesn't allow us to chose which end will be played depending on other parameters. The current way to do is to allow the end of the sample to be played if this is a part of interest, associated with a short release time. The release time defines how quickly the sound is muted after the release of the key, and if the key is released before the envelop reaches the highest level (sustain), the release will begin with a lower initial state.
There is room for improvements regarding the sf2 format. Maybe one day this will be one of them.