Like others, I too do this more than I would like to admit... In fact, just before reading this I did the exact thing by telling my friend I can't make our night out this evening because I really do not feel like I could cope with it... Instead I will stay at home where I feel comfortable (aside from issues with relationship, but that's another issue...). I often prefer my own company over social situations.
I am trying to get better by taking smaller steps, then making sure I recognise and appreciate them... e.g. going out for lunch with a friend one on one instead rather than a big night out (actually getting there instead of bailing last minute). Some days are better than others but when I succeed I feel quite refreshed, and then don't feel so bad about spending time by myself to relax/ recover XD
Hope you are feeling better soon