What emotional response, KeenReader? Just smile and say "congratulations" sincerely or insincerely and your obligation as a guest is done, I think.
The emotional response is internal-having to suppress how I feel about being at a wedding at a time when I had no expectations of being at one. Even with a loved one's wedding, I need some advance notice to prepare to deal with this kind of response, and with a surprise wedding, I'm not getting one.
Smiling and saying "congratulations" might be the basic requirements of being a guest-but I'd prefer to decide for myself if I'm going to be a wedding guest, and not have that imposed on me. Add to that that I might have accepted an invitation for a relaxing time, and this is not only not relaxing, but I may well not support the marriage for whatever reason, and I have just become a captive audience to it. Unfortunately, I think leaving would be too pointed and too unsubtle a way to deal with it and would generate hurt feelings.
So, I'm sorry, but I don't support surprise weddings, regardless of the motivation for it.