I understand the 'hammer' imprisoned any Goa'uld who came through the stargate (at least until SG-1 broke it), but could it have done anything if any of the system lords sent a warship to attack Cimmeria?
Yes and no. The whole point of the "Hammer" is that it scoops up any Goa'uld or Jaffa who come through the Stargate, depositing them in a maze where they're offered the choice of dying or giving up their hosts.
As to whether a device with such a limited scope would protect the planet, that depends on your definition. While it doesn't directly protect the planet itself (e.g. in the sense of swatting incoming ships out of the sky), it does provide a level of defence in that the Goa'uld are very predictable. Finding that the planet is uninhabitable when their scouts don't return, they're then much less likely to bother sending one of their motherships.
DANIEL: Cimmerians use the word Etin for Goa'ulds. Gairwyn said the Etins are there. For a thousand years Cimmeria was safe from Goa'uld attack. Then we show up and screw up Thor's technology.
TEAL'C: Daniel Jackson is correct. The Goa'uld usually send an advance scout though the Stargate to determine a planet's worth and vulnerability. If none of the scouts report back, it is a deterrent to invasion.
Although this seems relatively scant protection, it evidently worked for a thousand years, then almost immediately stopped working after the SG1 team broke the Hammer.