GameRules

The GameRules is a singleton in Source based games that stores a lot of information about the current game being played. Team scores, play order, winners, round information, etc. are all stored in this class. Most of the L4D2-relevant vars are in the CTerrorGameRules class. You can see a full listing of variables available through the CTerrorGameRulesProxy netprops list. Most of these variables can be edited or queried directly thanks to the SM1.4 sdktools_gamerules functions.

Useful variables
The following are some basic descriptions of variables available through the GameRules class.

m_bAreTeamsFlipped
To use a number of the gamerules and director variables, you'll need to determine which team is "team 0" and which team is "team 1". This variable can help you determine that.

When m_bAreTeamsFlipped is false, the team currently on survivor is team 0. When m_bAreTeamsFlipped is true, the team currently on survivor is team 1. The utility of this variable should be obvious. It's highly recommended that you use it over other team-number-determining methods.

m_iSurvivorScore
Array of length 2 (one entry per team)

This variable is used to store the current survivor distance score total. It will increment automatically (as distance scores are updated) during the map. You should not be able to override this during playtime, but you might be able to set it OnEndVersusModeRound if you want. Once OnEndVersusModeRound executes, this value will be added to survival bonuses and stored in m_iChapterScore and m_iCampaignScores. Once the value has been added, m_iSurvivorScore variable will be reset to 0 for both teams.

m_iVersusSurvivalMultiplier
Array of length 2

This variable stores the survival multiplier for each team. It only gets updated during OnEndVersusModeRound (which is also when score calculation is done), so there's not a lot of cool ways to use this variable as far as I can tell.

m_iCampaignScore
Array of length 2

This variable stores the campaign scores for each team. Once again, it's updated OnEndVersusModeRound, so don't expect to see live updates.

m_iChapterScore
Array of length 2

This variable stores the chapter scores for each team for the current round (map). OnEndVersusModeRound, it is set to m_iSurvivorScore[i] + CalculateSurvivalBonus. Then, m_iCampaignScore is incremented by this value.

m_bInSecondHalfOfRound
This variable can tell you whether you're in the first or second round of the map. Obviously this is referred to as a "half" internally, and a single map is referred to as a "round". Not sure when this variable is updated, but you can use it safely OnEndVersusModeRound (pre hook at least).