Shock is your body loosing the ability to compensate for the situation. There are several factors that go into it, pain, bloodloss, temp, among others. Normally you can compensate for one, but several get tough, and while shock on its own won't kill a healthy person, it can set off other things. And obviously if you are bleeding heavily, internally or externally, the bleeding is the problem that will kill you, the shock is really just a symptom.
Keep yourself warm, or at least keep yourself from loosing more heat, so wrapping yourself in a space blanket, or even just a tarp is a good start. Your body naturally pulls blood to the core to keep the organs alive, but that makes you feel cold, which triggers the blood back to the skin, dropping your overall blood pressure. by keeping warm, the body can keep the blood pressure up without the heart having to work extra hard.
Reduce the pain. Clenching in pain can act on the vaso-vagas nerve which controls blood pressure, so you are inadvertently lowering your blood pressure. Splinting can help that in the short term.
Keeping calm, and breathing slowly helps as well, people hyper-ventilate without realizing it. Rest if you need to. I've had the beginnings of shock a couple times, just from pain. Once when I broke my arm, and once when I badly twisted my ankle. It was hard to breath, but by focusing on that I was able to quickly recover.
Sitting down and focusing on one thing at a time is important. You might pass out, but as long as you are not bleeding, your body will quickly compensate and you'll be back, as long as you didn't fall and bash your head. Shock is the symptom of your body decompensiating, so if you can support a few of the key aspects, the rest will come back on-line.
The adrenaline rush can be an advantage if you can use it, but for lots of people it just spikes their heart rate (but lowers flow) and gets them breathing fast and shallow. Not a good combo for getting oxygen around. Its also why people can go into shock from something really minor, or just by thinking an injury is worse than it is.
For aiding someone else with shock, its very similar, you are trying to support as many functions as you can, so that the body can take care of the other ones.
There are some other interesting factors that play into it. For you, your body probably felt that it could take a bit of a break since it was safe to do so. I know people who have passed out hours after an event because they were in a safe place. In your situation your best bet for beating the shock would have been to keep warm and ride it out. some calories might have helped in that case, as you can burn a surprising amount of fuel from pain. Something fast like chocolate. Sounds like you did not bad there. One thing to keep in your memory is what it felt like just as the shock was setting in. Its different for everyone, but later on it can be a good indicator of danger. I know that if my ears start to feel numb, and my hearing goes, I've got about 10 seconds to lay down before I fall down (long hot-tub soaks on an empty stomach, not that healthy) That way if something happens and the shock starts out of the blue, you have some warning.