A half-marathon is a long race, but not so long that you can afford to use the first 2 or 3 miles as a warm-up, especially if you have a specific time goal, or hopes of winning an age-group or overall award. Therefore, a thorough pre-race warm-up is essential. Typically, the longer the race, the shorter the warm-up, so you don't need to do as much as you would before a 5K or a 10K, but you still should be ready to run goal race-pace right from the gun.
Begin your warm-up about 30-45 minutes before the start of the race. Start with an easy 10-15 minutes of light jogging. Don't worry about your pace - the purpose is just to increase blood-flow to your muscles, preparing them for the harder running still to come. Next, I've always liked to do a few minutes of stretching. Running is a fast, ballistic movement, so your stretching should mimic that. Slow, static stretching is fine after you run, but beforehand, you want to ensure there is plenty of elasticity, or "snap", in your muscles, so any stretching you do should go through a similar range of motion, and be at a similar speed, to the movements you will go through while running. I like to stand facing my car and, holding the car for support, swing one leg side to side in a quick, controlled movement. Repeat with the other leg, then stand alongside the car and, holding on with one hand, swing the opposite leg forward and back. Turn around and repeat with the other leg. Keep your knees as straight as possible while doing these to work the correct muscles. I do 15 reps of each stretch with each leg, and find these really warm-up my hips, abductors and adductors, quads and hamstrings.
Next, change into your racing flats (if you wear them) and make any last-minute visits to the bathroom. Try to head toward the starting line with at least 10 minutes remaining. To finish my warm-up, I like to do 2 or 3 100-meter strides. Find an open stretch of road, either in front of the starting line or off to side, and do some quick pick-ups. These shouldn't be sprints - they should be in-control and no faster than one-mile race effort. These will continue to prepare your muscles, and your cardiovascular system, for the faster running ahead. Finally, line up with the other runners and get ready for the start. This should have all your systems properly warmed-up and ready for a successful race.