After research and code changes, I have found the fix for the issue.
In the UI Namespace example, we need to include a function to check previous saved settings and populate UI based on that. We can see the settings saved by opening the .twb file.
Previously only selected data sources was saved as the settings. But I have included a code to save the selected interval as the setting in addition to data sources. This will be useful to retain the state of the interval when the user clicks on configure next time.
The full code changes for the extension is available in GitHub. Now once we make changes in Tableau Desktop and publish it to Tableau Server, the configuration will be saved.
This changes will also solve the web editing issue (editing the extension directly in tableau server) .