Bit more on the procedure of a marriage by declaration before witnesses.
The declaration before witnesses, not whatever ritual is performed by a clergyman, is the crucial element of a legal marriage in Scotland. So you could get married anywhere, any time, any place, simply by declaring in front of witnesses that you were husband and wife.
However from 1855, if you then wanted to get the marriage registered, you had to go to the sheriff with your witnesses and tell him, and the witnesses had to back you up. You then got a warrant which you took to the Registrar and which gave him authority to include your marriage in the statutory register of marriages. This procedure was done away with in about 1939/40 when civil marriages by the Registrar became available.
I think the term 'irregular marriage' was officially dropped once statutory registration was introduced in 1855, but I am happy to be corrected about this.
The kirk definitely frowned on irregular marriages, and it's not unusual to see in the Kirk Session minutes a reference to a couple being hauled up before the Session and admonished for an irregular marriage, fined a sum of money which went into the poors fund, and made to stand in front of the congregation to be humiliated for the 'sin'.
Here are examples from my own tree:
Decr 30th 1775. This day by appointment John Waddle came before the Sess and presented Lines of Marriage with Jean Cuthil dated at Edinr August the 3d 1775 Upon which the Sess appointed him and her to Compear before the Congregation Sabbath first and although she was not to Compear they would take him under discipline for the same. [New Monkland Kirk Session minutes, National Archives of Scotland CH2/685/3/143]
Campsie, 11th Sep 1835. Compeared David Waddel and Jean Dalgliesh and owned their irregular marriage producing a certificate from a Justice of the Peace to that effect, and were recognised as Husband and Wife by the Kirk Session, and suitably reproved for their irregularity. [Campsie Kirk Session, National Archives of Scotland CH2/51/4 p 9]
11th Sep 1835. David Waddle and Jean Dalgleish both resident in Campsie owned their irregular marriage to the Kirk Session of Campsie of this date. [Campsie Parish Register]
1803, Jany 23rd. Which day Alexander Yorkston miner Castlerankin and Anne Kincaid servant Castleranken acknowledged they were irregularly married on the fourteenth day of December last and produced lines to that effect. [Denny Parish Register]
July Collected 1770. And Storry and Mary Lindsay for pro and irregular marriage £0-4-0. And Storry and Mary Lindsay penalty £0-11-0. [New Monkland Parish Register]
Janr 29th 1756. Compeared voluntarily John Rankine and Lilias Waddel and produced a Testifiate of their irregular marriage dated Janr 24th 1756 (no place mentioned) and signed by David Paterson Minr (as he designs himself) and two witnesses. They adhered to their marriage, were suitably exhorted and rebuked for their irregular behavious. [Falkirk Kirk Session Minutes, National Archives of Scotland CH2/400/10/137]