Congratulations eg_lim on completing your first plug-in modification
There is one problem that I see with this (modified) plug-in, which is that it requires
a silence at the end, otherwise it messes up.
Here's my test track. It has 3 sounds, each of duration 2 seconds, and each of different amplitudes so that they can be easily identified visually. The space between each sound is 3 seconds.
If I select the whole thing, including the trailing silence, then it works as expected. With default settings, the result is:
However, if there is no silence at the end, or only a short silence at the end, like this:
then the result is:
Also, it is highly recommended to set your text editor to use spaces rather than tabs, so that indentation is consistent when viewing the code.
There's also quite a few minor things that could be improved, several of which come from improvements to Nyquist in Audacity that were made after "Extend Silences" was written. If you would like me to detail these I'd be happy to do so.