Good Morning Shubha.
Coding a 'button-with-its-process' in a Java script seems a very difficult task to me.
When possible at all t is. It might be that 'some one else' in the community has already been doing such.
As for a possible future implementation for this in CA Service Catalog Form Designer, I can propose to add an Idea in the Communities.
And I then want to encourage you to open an Idea in the CA Service Catalog Community.
To get your idea voted for and reviewed by us there after.
For us to see whether it is possible to get this functionality implemented in a future release of the product.
Thanks in advance for your efforts on this and kind regards, Louis.