I'm sorry to tell you this but I don't think the RPG stackexchange is going to be able to help you a lot with this. The issue is really specific and requires the solution to be tailored just for him. If you need help on the matter I suggest you ask a psychologist for tips.
I can make a few suggestions on how to deal with the situation but please note that I have zero experience with dealing with this kind of issue, opposed by your 10 years. You'll have to decide for yourself, using your own experience and wishes if these suggestions are worth considering. And on a sidenote, thumbs up for being a good friend to him.
Play with his friends
If playing with strangers makes him uncomfortable then try and play with friendly faces. These people will (hopefully) know his issues and will be less mad at him for causes disruptions. You've learned to deal with your friend and learned to be around him. Strangers have not and might not be willing to do so.
Of course you can only play with friends if you have enough of friends that are interested in tabletop gaming.
Play solo campaigns, for now.
It is very much possible and enjoyable to play games with just one player. This might seem weird at first but it might be worth something considering. The main purpose of this is to keep him in his comfort zone. If it's just you he will have no reason to be nervous. If you do this for a while you might consider bringing in more players, one at a time. Just try to keep him in his comfort zone.
The problem with this solution is that your friend might consider this 'giving up'. My guess is that he knows rejection by now and will just consider this giving in to the rejection from other players. The point of this idea is to build up slowly and to work around his social anxiety that way, not to isolate him. So if you are going to take this route make sure to try and tell it him in a positive way. You'll have to use your knowledge about your friend to decide how to do this for yourself.
Also, solo campaigns take a lot of time to prepare.
Online gaming
This solution isn't great, but's it there. You and your friend could try and play in text based RPGs. Of course this is something that you need to enjoy and isn't a solve-all solution, it's more of a workaround. But if you both enjoy it them it might be something to consider.
Ask him for suggestions and feedback.
If anyone knows what the problems are, it's probably your friend. You've said this yourself in your post, but it's important enough that I'll repeat it here.
If you find any possible solutions or workarounds for said problems, talk them with through your friend. I know I'm just stating the obvious here but really is that important.
You might also want to ask him if he has any solutions for the problem if you haven't already (But I'm kind of assuming you already have.).
In short.
The gist of these suggestions is to work around his social anxiety as he obviously (and understandably giving his condition) has a lot of issues with it. Try to get him in a comfortable spot and hopefully his ticks will he less frequent. Make sure that you pick other players who are okay with playing with him.
One of two things is going to have to happen for your group to operate harmoniously. Someone is going to have change how they behave at the table or someone is going to have to leave.
Here are my recommendations for the former. What you've mentioned are actually two distinct (if possibly related) problems. One is that the player is incredibly defensive and the other is that the player is not into PvP in their games.
I'll start with the latter problem because its the easier one to solve. RPGs are a game of cooperative storytelling. That means that everyone has to buy into the premise for it to work. If the game is strongly built around PC conflict, then first you need to make sure she understands the nature of the game. If, after the explanation, she's still not buying in, it may be better to ask her to leave the group. You could still invite her (or everyone) to play a game that is not PvP oriented.
On the other hand, if this is not a PvP oriented game then it may be better to have a conversation with the group about My Guy Syndrome. Explain that there is almost always another choice that makes sense besides attacking the other PCs and unless both players are into PC conflict, it is probably best not to.
If that doesn't resolve the issue on its own, remember that people can't control their feelings (and its generally unhealthy to try) but if they understand their feelings they can better control how they react to them. So my recommendation would be that the next time she starts displaying passive-aggressive behaviors, wait until she is ready to leave and then (depending on circumstances) either walk her outside or ask her to wait behind and talk to her about how she's feeling. Don't judge it; just "You seemed pretty upset during the game. I'd really like to help you enjoy the game. Would you tell me more about how you were feeling and what made you feel that way?" Whatever you do, don't question how she's feeling. Instead try to understand what she's feeling and why. Once you do, you can start asking questions like, "That sounds very frustrating. However, they're not shutting you down because they don't like you. People need to point out when a solution isn't likely to work because if they don't there are usually consequences. But maybe there's another way we can handle that. If you were in their position, how would you handle that problem?"
Best Answer
These are all interpersonal problems rather than gaming ones. Here's how I'd handle each of them.
Same Character I'd tolerate it. Not a big fan of this kind of behavior, but it happens. I think it's a roleplaying maturity thing.
One thing I used last game might help you. I like the list of 100 questions about your character, but didn't want to overwhelm my players with homework. Instead of asking them to fill out the list I asked them all 1 question from it before each game. This worked great because it helped grow their characters as the game progressed and because it was one question at a time they actually put thought into the answers.
I bring this up because some of the questions were useful tools to differentiate the player from the character. Asking them what advice the player would give the character, how the player and character would disagree, etc, was useful for the players who were a little too close to their characters. You could ask everyone this like I did or even ask her alone.
Setting inappropriate powers I'd brainstorm with her. "No, you can't play a robot because they don't exist in the Forgotten Realms. How would you feel about a golem?"
I think the important thing here is to work with her rather than restrict her. The idea isn't to keep her from playing a robot. It's to figure out what she is trying to express by playing a robot and then figure out a setting appropriate way to express the same thing.
Since you are the party who knows the most about both the restrictions and features of a campaign setting, you're in a better position to figure out alternatives to her ideas than she is.
I also find it helpful to use book and movie examples as a good way to communicate the feel of the game you're going for. I was trying to run a gritty and dark campaign, but one of my players wrote a 5 page faery tale for her background. With her permission I altered it, but it was clear that she wanted to play a G/PG character in my R rated game. Neither of us were happy.
Since then I've told my players what books or movies inspired the game I'm planning on running. This doesn't have a perfect success rate, because some players won't read books, but it's drastically cut down the number of mismatched characters I received. If only the Game of Thrones TV show came out before I ran my GoT game, the players might not have tried to act like an adventuring party.
Finally, it is possible that a character can't be fulfilled in a certain setting or even a certain campaign. As GM you need to recognize when this is the case. In this case I'd suggest having the player shelve that character until the next game.
Multitasking Intolerable. It's one thing if she's off screen for a while, but if she's playing she should play. If she doesn't have time for the game or if she isn't interested enough to play 100% of the time, she shouldn't be there.
This is one case where I wouldn't go for the one on one conversation. It would seem like you're bullying her. I'd lay down the law in front of everyone so that it's obvious the same rules apply to everyone.
For how to approach the situation, I think it depends on what kind of multitasking the player is doing. I'm willing to be less than polite to someone who is playing video games at my table. For homework, I'd ask nicely. Homework is an obligation, video games aren't. I'd also offer that the player could skip the game session.
Sometimes players feel like game sessions are an obligation too. I had one player with anxiety issues who was getting stressed out about game, but didn't want to miss hanging out with people. The answer for him was to invite him to come hang out while we game, but have no character of his own. I let him play NPCs when he was up for it. If your player is stressed to attend session and finish homework, try telling her she can stay at the table but not play while she's doing her homework and then when she finishes she can come back in. Tell her that it's not that you don't trust her to handle both, but that it's distracting for everyone else.
Also, to clarify when I say multitasking is intolerable, I mean playing RPGs and doing something else entirely. If you're playing game and looking up spells for your next level or writing your backstory, that's fine by me. Your head is still in game mode. Depending on the game, I might even allow miniature painting, but that's pushing it. (The sort of game where I've seen that done in a reasonable way is 3.5 with long combats. When it's 30+ minutes between turns, putting another shade of red on your cloak is entirely reasonable.)