Okay sorry, that was ridiculously long.
Seen worse. Nice story by the way.
The story did, however wear me out, so I have not read all the comments... which I assume are excellent.
A couple of suggestions:
1. Talk to your buddy before the dive and make sure just how experienced he is. Weighting conversation is always an excellent topic.
2. Agree on turn around point... agree on how the return will go... agree on a gear check when you first get down... look for leaks.. have him look for leaks.
3. At the first sign of BOBO the clown behavior...abort the dive.... or do the dive in one spot.
4. If you are not going to abort the dive, and leaving him is not a good option (shore dive in kelp is usually a bad place to do that), then make the dive really, really easy.
Note: In calm enough conditions, I write in the sand for the way back... makes the return easy and takes time.
On the surface, I think you did fine. You panic, and he will go over the edge... you act calm and at least he will not get worse (usually). I like to get close and be very comfortable and in their face. Been known to talk about almost anything.. had a nice car conversation once with a diver near panic.
The second dive