If a solar flare happened during a total lunar eclipse, would the Earth block the flare from hitting the moon?
Probably not, for several reasons.
The high frequency electromagnetic radiation from a solar flare isn't what does the bulk of the damage to power grids and such. It's the huge stream of charged particles released by coronal mass ejections (CMEs) that are sometimes associated with solar flares that do that damage. For example, it wasn't the solar flare itself that did the damage to telegraph systems on the Earth during the Carrington Event. It was the CME associated with the flare. While it took only eight minutes for the electromagnetic radiation from the flare to travel from the Sun to the Earth, it took over eighteen hours for those charged particles to travel from the Sun to the Earth -- and they followed a curved path.
This means that if a Carrington-level solar flare did happen during a total lunar eclipse, the Earth would have shielded the Moon from the direct effects of the flare. However, the eclipse would have been over by the time the CME hit the Earth. It gets worse.
The Earth's magnetic field has a huge cross section to charged particles emitted by the Sun, much larger than the Earth itself. The magnetic field protects the Earth against all but the worst devastations from the Sun. Even then, the vast majority of the charged particles are swept aside by the Earth's magnetic field.
This magnetic field has a very long magnetotail that extends beyond the Moon. Unlike eclipses, which are rare, The Moon crosses the Earth's magnetotail every month. It takes the Moon about six days to traverse the Earth's magnetotail. The problem is that this magnetotail is highly turbulent, particularly when the Earth is hit hard such as by a CME. Most of the charged particles ejected by a CME are swept aside by the magnetic field, concentrated in the outer fringes of the magnetotail. The turbulent nature of the magnetotail means the Moon would be occasionally inundated with a huge flux of charged particles should a Carrington-level event occur.
A solar flare that occurs during a lunar eclipse would mean that lunar colonists would need to get deep underground, and would need to protect equipment such as solar arrays left on the surface.