Measurement of the solar neutrino capture rate with gallium metal. III: Results for the 2002--2007 data-taking period