I too have been trying to connect Barbara to the documented Humes. What was your source for Sir James's brother bailing Him and William Hoge out of Jail? I have been unable to locate either of them on the roster of persons imprisoned in Dunnotter. My research has led me to believe that there are a few discrepencies in the old story, but I can neither prove or disprove that.
What I have found is a book (i'll have to find the name again in my notes) written in 1890. This book make reference to a "Miss Hume" who came to Perth Amboy around the same time as Dr. John Johnstone from Edinburgh. She is listed as his sister's daughter. The book states it is not known what happened to her parents. Dr. John Johnstone came to the colonies willingly in Dec 1685 on board the "Henry and Francis" the "Caledonia" made that same journey leaving one week before the "Henry and Francis". This is the same John Johnstone who married Ephram Scott. Interestingly, Ephram's parents both died of some kind of pestulence on the journey over and John Johnstone became her protector. This is all well documented. Ephram's father was George Scott Laird of Pitlochie who had been in prison as a dissenter but was released on the condition he cammand a ship of prisoners to the colonies.
So where does this leave Barbara? My current theory is that she was orphaned in Scotland and William Hoge was some sort of friend of the family who accompanied her to live with her uncle. I am not entirely convinced Sir James was even imprisoned as a dissenter because I have not found one James Hume in any list of dissenters. But I am almost 100% convinced that he never made it to the ship. I think it is possible Ephram and Barbara's stories got mixed up. I also think it is possible the date 1682 comes from documentation of a William Hogg in the colonies in the year 1682. This man, however, was a surveyor for William Penn. He has a completely different documented wife and list of children and is clearly not our William Hoge.
The Hume families I am currently researching as possible ancestors for Barbara are Humes of Blackadder, Manderston, Hume of Home, Ninewells, Kimmerghame and Coldenknowes. These families all link back to the Humes of Wedderburn and intermarried a lot. I do believe the David Hume Sir James is supposed to have been the great Nephew of is David Hume of Godscroft.