Hi Srinivasan,
Create an indicator field and make it value false by default and change its values in the custom action button script.
When ever button gets clicked script gets run then change the element value to true.
And in the front end bind the visibility of the mashup embedded section to the indicator element.
Thanks,
Siraj.