Are you absolutely 100% certain that the marriage ceremony took place in the kirk building itself? Does the marriage certificate explicitly say so?
I ask because in the 1850s it was very much the exception for a marriage to take place in the kirk building. The traditional place for a wedding ceremony was in the bride's home or, if she had no living parents or was marrying a long way from home, in the manse or in her employer's home. See
https://www.gla.ac.uk/schools/socialpolitical/research/economicsocialhistory/historymedicine/scottishwayofbirthanddeath/marriage/So unless the place of marriage in the certificate actually says, 'in the parish church' you cannot assume that they were married in the kirk itself.
Robert Wright (1800-1897) was Minister of Dalkeith from 1851 to 1876.
His predecessor, writing in the New Statistical Account in 1845, says, "An elegant church of the English Gothic style was built in 1840, by His Grace the Duke of Buccleuch, on a commanding site at the head of the town .... the unsettled state of the Churchfor some years, and recently the secession that has taken place .... has rendered an additional place of worship in this parish, connected with the Establishment, unnecessary ...." ('The Establishment' means the Church of Scotland.) From this it is clear that there was only one Church of Scotland in Dalkeith in 1845. See
http://stataccscot.edina.ac.uk/static/statacc/dist/viewer/nsa-vol1-Parish_record_for_Dalkeith_in_the_county_of_Edinburgh_in_volume_1_of_account_2/ (Page 502)
This kirk replaced a building of the 15th century. See
https://canmore.org.uk/site/53417/dalkeith-east-kirk-church-of-st-nicholas and
https://canmore.org.uk/site/211694/dalkeith-old-edinburgh-road-buccleuch-churchIn 1853, a
quoad sacra Dalkeith West Parish was split off from Dalkeith, and a new kirk was built, also by the Duke of Buccleuch. The second minister there was John Anderson, who served from 1857 to 1863.
So if your James Benson and Isabella Armstrong were married by Robert Wright, not by John Anderson, they were married by the minister of the St Nicholas Buccleuch kirk. They probably attended services there, but more than likely were not actually married within its walls.