Martin, I think your timeline works, but remember Martha Giles would be a *granddaughter* of Samuel Hayes, not a daughter so I am not sure why she would be listed first. My reading does say that Martha Hayes Pinkham died before Samuel Hayes (bef 1762 vs abt 1770), which would explain a granddaughter being mentioned.
History of Dover by Scales has *Abigail* Hayes m. Tristam Pinkham, not Martha. (Based on Abigail Pinkham listed in the will?). But, it lists only Mary and Agibail as ch. of Samuel and Leah. (Note: the GDMNH mentions only 2 dau rec 1721-1728)
Greene's History of Boothbay has a date of birth for Martha Giles of 7 April 1737 (unsourced - could be family data or a gravestone). This early date matches well with Joseph Giles b. 6 Oct 1735 and works for father Tristam b. 1712, but a little early for mother Martha Hayes b. 1721.
I realize these are all secondary sources, but the exact dates suggest access to family Bibles or town records. The History of Boothbay supposes that Martha Pinkham (w. Joseph Giles) is the sister of Benjamin Pinkham of Dover who came to Boothbay, but that may be based on Sinnett's genealogy of the Pinkhams, which was published earlier and has errors that you have pointed out.
Martha is unlikely to be the daughter of Thomas Pinkham and Marcy Allen (per Sinnett) as they were m. in 1700 and cannot be having chldren 37 years later.
Thanks very much for the response and the help in puzzling this out. I think I need some more primary sources.