Hmmm. These are really good questions.
On the first issue, I suppose if you have been invited to *any* party, etiquette allows you to either accept or decline the invitation. I would imagine it applies even to parties that are planned specifically to celebrate you, the guest of honor. I suppose the decline could be phrased as "thank you so much for your kind offer, but I must decline. I'm afraid I'm too uncomfortable to be the center of the festivities." The reason I say that is because if you offer a decline based on a theoretical scheduling conflict, then the party host could come back and offer to re-schedule for another time. So in this case, I think the most polite thing to do is be honest about your wish to not have that party thrown for you. A lot of people are really uncomfortable with the idea of being "the center of attention", and for them, rather than experiencing pleasure, they wind up suffering anxiety or upset - certainly things that a kind host would never seek to bestow on their guests, even unintentionally.
In the case of a surprise party, I guess it would be rude to show dismay or to turn around and abruptly leave. I don't know the proper etiquette, but I honestly think the best thing to do would be to "go along with it" and stay long enough to mingle (briefly)with the guests, accept their birthday wishes (or whatever the purpose of the party is) and stay just long enough for a toast? And then once the party is in 'full swing' and once the main activities are finished, say your thanks and goodbyes and then you're free to leave? I think that's what I would try to do, no matter how uncomfortable. I don't think even the guest of honor is required to stay for the entire length of the event - I think a half hour to an hour max is all that is required.
But that's just my opinion and guesses. I would be interested in what others have to say myself.
**edited by mrkitty for syntax**