Render As Loop

I use render selection to sample a lot, and when I do it is almost always to use the selection as a loop in my composition, so a problem I encounter often is that the sounds jump when the rendered loop starts over because it’s missing all the tails from the ending of the selection. It’s super easy to avoid this problem, just copy paste the selection so it plays twice, render that and delete the first half. However, wouldn’t this be easy to add as a feature? It would also be neat to be able to render the entire composition so that the output would loop nice with all the effects ect. for using the material in other applications, especially mobile devices that can’t handle many effects.
I’m 99% sure that this can be done as a script, but all the only script I ever made did was say ‘Hello world!’… perhaps this would be a good project for learning lua.

is it me or is all that is required to do this is render the section twice, so instead of stopping at the end and cutting off the tails, continuing, going back round and thus doing essentially the same as what you are doing manually? in other words, i also think it is 99% certain this could be scripted.