Hi,
It would seem that we are cousins of some description
My connection to the Logies is via Agnes Logie's older sister Margaret (c1817 - 1892), who was my 3 x great grandmother. Margaret married Alexander Dunlop (1815 - 1888) around 1839. I grew up less than a mile from where they all lived.
The Logies and the Cunninghams seem to have been connected over a couple of generations, as I'm sure you know.
My 2 x great grandmother was Mary Dunlop (1854 - 1942), the daughter of Alexander Dunlop and Margaret Logie. Although Mary married John Thomson (1846 - 1904), I can't see a connection to your Thomsons as John was born in Torphichen to John Thomson and Helen McPhail. John senior was originally from Polmont and Helen was from Stirling. John snr and John jnr were both Coal Miners.
In relation to the Logie ancestry, I don't have much more than you do. I have Agnes and Margaret's parents as John Logie (c1785 - 1865) and Janet Whitelaw (c1795 - 1878). From the 1861 census, I believe John may have been born in Ferniehirst(?), Edinburgh and was a Cotton Weaver. His parents from his death certificate were Thomas Logie, Corkcutter and Janet Heughs (Hughes?), for whom the only matching marriage I can find is in 1781 in Troqueer, Kirkcudbright, although I'm not sure if this is correct as the geography of Troqueer to Ferniehirst to Whitburn/Blackburn seems a bit much for the time. I have no other details about them. Regarding John's wife Janet Whitelaw, I have her parents as Robert Whit(e)law and Margaret Miller or Millar, who I believe were married on 3 June 1792 in Whitburn. I have no more details about them and hadn't made the connection to Robert's birth in 1755 or his father, William.
I have information on a few of the children of John Logie and Janet Whitelaw, particularly the family of their son John Whitelaw Logie and would be happy to share this with you if you don't have this already. I'll send you my email address by PM.
Best wishes
Rockford