You were looking at the Marriage Banns which were published in Edinburgh for Sophia and Ayr for James Murray.
William McLaren and Janet Dewar had children in both Dull(incl Sophia)and Logierait parishes.
You will find William at 1851 in Scone under the name McLaurin with his son Robert and Granddaughter Margaret.Janet Dewar seems to have died as William's wife is given as an Ann.All other details fit.William did not register either of his marriages.
In Dull at 1841 there is a Sophy McLearen aged 6.She was born Margaret Sophia McLaren in 1836 to Alexander McLaren and Elizabeth Stewart.Wouldn't be surprised if she was a relative of Sophia.
It seems reasonable to me that Sophia born 1821 in Dull ,married 1849 in Edinburgh and in Dundee with James Murray in 1851 is the same person.Whether she went to Australia is not clear.Did she take her children with her?There is a parentless Jessie Murray in Ayr aged 11 in 1861 who might be Sophia's daughter
I really did not understand it, and there is an entry on the IGI, which does not make it very clear either....I won't say anymore about that one.
I found the 1851 census record you mention for William McLauren, so then I checked the 1841 census - found William McLaren living at the same address (Oakpark).
This time his wife appears to be Elizabeth (b.1801), the ages of the children, if these are the ones he had with Janet Dewar - do not seem line up with the births recorded on the IGI.
I don't know what to make of the daughter Margaret Sophia born, to Alexander McLaren & Elizabeth Stewart - I can't find this on on the 1841 census. Found on the 1851 census a Sophia McLaren - age 17 (paupers daughter) - with her mother Elizabeth Stewart, they are at Dull Perthshire.
I agree with your reasoning that the James Murray who married Sophia McLaren (b.1821 in Dull) in 1849 Edinburgh is the same one.
The only thing is that James Murray was not born in Ireland, as has been recorded on this 1851 census.
The Jessie Murray b.1850 - to James & Sophia Murray, did emigrate to Australia with them, although I'm still to find that shipping record.
She appears on the Victorian BMD Indexes.
Many thanks for posting that information that you found.
Sarra