To record the demo portion:
1: Get in a game that uses the Source engine.
2: Turn your graphics down, not bottom level, but down a little bit, this insures you will get the best quality *
2: Do whatever you need to do to get the scene ready, maybe you don't need to do anything, maybe you need to set up some props or whatever.
3: Type in the console "record game1" **
4: Record the action that you need
5: Type in "stop" in console
To Record the movie:
1: Go to Options>Video and change the display mode to "Show in a window". The other one besides fullscreen. Whatever resolution you want, although I haven't tried setting the resolution higher than my screen resolution.
2: Type in host_framerate 30.
3: Before playback of the demo, type in "startmovie moviename avi" Yep, you add a space and the letters "avi" after your moviename.
4: Wait
5: A little box will pop up, asking you which kind of codec you want to use. If you are using Sony Vegas (or Premiere? Haven't tried yet) then click on Microsoft MPEG-4 V3. If you are using anything else, go with Xvid.
6: Movie is being recorded. After the demo finishes, just type endmovie in the console.