You're right: with a sample-based performance there is indeed looping going on. In Reason, if you look at the NN-XT Advanced Sampler for instance, you'll see there are settings per sample for where you want the loop to begin and end, and whether you want the sample to play forward/reverse or forward only etc. ("Play Mode").
You can achieve a great deal in this sampler so you might consider using that instead of creating your own bespoke sample player. Here's a tutorial that might give non-Reason users an insight into what it can do.
However, sound files themselves can include looping information in their meta-data. I don't know for sure that the mp3 format can support this, as I've been working with wav files for this. I can open them in my sound editor (Sound Forge) and view the loop editor. This gives me very fine control over where to begin and end the sustain loop, down to the wave form and sample level so that the "join" between the loop end and its beginning can be arranged with the minimum of noise (e.g. make the wave continue its slope smoothly without adding sudden jumps that might create a click). It looks like a simple job but depending on the sound it can be quite tricky to ensure that sound continues without a noticeable change in timbre etc. Anyway, having edited the sustain loop in the wav I can then load that into the sampler and it recognises the data and performs that loop according to pedal control etc. Here's a tutorial on editing loops.
So, if you want to implement a sustain in your mp3 player, you probably need to understand whether mp3 can indeed include sustain data and then whether or not you can control the playback according to that; then you need a means of creating / editing the loop in your sample. I suspect that mp3 might not support looping and my brief search for such information has not revealed anything to the contrary. Please do update this item if you find it does - I shall be very interested to hear more about your project! Good luck!