The fall of Scotland appears to be just as complicated as Hungary but with the added bonus of having a lot of writing about the wars of the time period and very little on religious reformation. So for context, the reigns of the Kings of Scotland during this time period:
King Macbeth of Scotland 1040 - 1057
King Lulach of Scotland 1057 - 1058
King Malcolm III of Scotland 1058 - 1093 (Married Margaret of Wessex 1070)
King Donald III of Scotland 1093 - 1094 Brother of Malcolm III
King Edgar of Scotland 1097 - 1107 fourth son of Malcolm III
King Alexander I of Scotland 1107 - 1124 fifth son of Malcolm III
King David I of Scotland 1124 - 1153 last son of Malcolm III
Queen of Scotland Margaret of Wessex Great niece of Edward the Confessor and wife of the King of Scotland Malcolm III
She instigated religious reform, striving to conform the worship and practices of the Scottish church to those of the continental church. This she did on the inspiration and with the guidance of Lanfranc, a future archbishop of Canterbury. Due to these achievements, she was considered an exemplar of the "just ruler", and moreover influenced her husband and children, especially her youngest son, the future King David I of Scotland
The chroniclers all agree in depicting Queen Margaret as a strong, pure, noble character, who had very great influence over her husband, and through him over Scottish history, especially in its ecclesiastical aspects. Her religion, which was genuine and intense, was of the newest Roman style; and to her are attributed a number of reforms by which the Church in Scotland was considerably modified from the insular and primitive type which down to her time it had exhibited. Among those expressly mentioned are a change in the manner of observing Lent, which thenceforward began as elsewhere on Ash Wednesday and not as previously on the following Monday. Malcolm was largely ignorant of the long-term effects of Margaret's endeavours, not being especially religious himself. He was content for her to pursue her reforms as she desired, which was a testament to the strength of and affection in their marriage
Alexander was the fifth son of Malcolm III and his wife Margaret of Wessex. Alexander was named after Pope Alexander II
In 1250, Pope Innocent IV canonised Margaret in 1250 in recognition of her personal holiness, fidelity to the Roman Catholic Church, work for ecclesiastical reform, and charity.
The brother of King David I of Scotland, Alexander I of Scotland died in 1124, David chose, with the backing of Henry I of England, to take the Kingdom of Alba for himself. David was forced to engage in warfare against his rival and nephew, Máel Coluim mac Alaxandair. Subduing the latter seems to have taken David ten years, a struggle that involved the destruction of Óengus, Mormaer of Moray. David's victory allowed the expansion of control over more distant regions, theoretically part of his Kingdom. During this period too, a marriage was arranged between the son of Matad, Mormaer of Atholl, and the daughter of Haakon Paulsson, Earl of Orkney. The marriage temporarily secured the northern frontier of the kingdom and held out the prospect that a son of one of David's mormaers could gain Orkney and Caithness for the Kingdom of Scotland. Thus, by the time Henry I died on 1 December 1135, David had more of Scotland under his control than ever before. While fighting King Stephen and attempting to dominate northern England in the following years, David was continuing his drive for control of the far north of Scotland. In 1139, his domination of Caithness (then including Sutherland) was confirmed when his cousin, the five-year-old Harald Maddadsson, was given the title of earl and half the lands of the earldom of Orkney, in addition to Scottish Caithness. Throughout the 1140s Caithness and Sutherland were brought back under the Scottish zone of control. Sometime before 1146, David appointed a native Scot called Aindréas to be the first bishop of Caithness, a bishopric which was based at Halkirk, near Thurso, in an area which was ethnically Scandinavian. David soon found himself active and personally present in the north of Scotland because of the death of his cousin William fitz Duncan. William died sometime between 1147 and 1151, putting the huge lordship of Moray back into David's hands.
The term "Davidian Revolution" is used by many scholars to summarise the changes that took place in Scotland during his reign. These included his foundation of burghs and regional markets, implementation of the ideals of Gregorian Reform, foundation of monasteries, Normanisation of the Scottish government, and the introduction of feudalism through immigrant Anglo-Norman and Norman knights, as well as Flemish settlers. David's life as a "reformer" also has a context in the Gaelic-speaking world. This is particularly true in understanding David's enthusiasm for the Gregorian Reform. The latter was a revolutionary movement within the western church spearheaded vigorously in the papacy of Pope Gregory VII which sought renewed spiritual rigour, ecclesiastical discipline and doctrinal obedience to the papacy and its sponsored theologians. The Normans who came to England adopted this ideology, and soon began attacking the Scottish and Irish Gaelic world as spiritually backward – a mindset which even underlay the hagiography of David's mother Margaret, written by her confessor Thurgot at the instigation of the English royal court. Yet up until this period, Gaelic monks (often called Céli Dé) from Ireland and Scotland had been pioneering their own kind of ascetic reform both in Great Britain and in continental Europe, where they founded many of their own monastic houses. Since the end of the 11th century various Gaelic princes had themselves been attempting to accommodate Gregorian reform, examples being Muirchertach Ua Briain, Toirdelbach Ua Conchobair, and Edgar and Alexander I of Scotland. Benjamin Hudson stresses the cultural unity of Scotland and Ireland in this period, and uses the example of cooperation between David I, the Scottish reformer, and his Irish counterpart St Malachy, to show at least partly that David's actions can be understood in the Gaelic context as much as the Anglo-Norman one. Indeed, the Gaelic world had never been closed off from its neighbours in England or continental Europe. Gaelic warriors and holy men had been travelling regularly through England and the continent for centuries. David's predecessor Macbeth (King, 1040–57) had employed Norman mercenaries even before the conquest of England, and English exiles after the conquest fled to the courts of both Máel Coluim III, King of Scotland, and Toirdelbach Ua Briain, High King of Ireland. For the development of the parochial system, David's traditional role as its creator can not be sustained. Scotland already had an ancient system of parish churches dating to the Early Middle Ages, and the kind of system introduced by David's Normanising tendencies can more accurately be seen as mild refashioning, rather than creation; he made the Scottish system as a whole more like that of France and England, but he did not create it. One of the first problems David had to deal with as king was an ecclesiastical dispute with the English Church. The English Church's insistence on subordinating Scottish sees to the archbishops of York or Canterbury had, since his election in 1124, prevented Robert of Scone from being consecrated to the see of St Andrews (Cenn Ríghmonaidh). Since the 11th century, the bishopric of St Andrews likely functioned as a de facto archbishopric. The title of "Archbishop" is accorded in Scottish and Irish sources to Bishop Giric and Bishop Fothad II. The problem was that this archepiscopal status had not been cleared with the papacy, opening the way for English archbishops to claim the overlordship of the whole Scottish church. The man responsible was the new aggressively assertive Archbishop of York, Thurstan. His easiest target was the bishopric of Glasgow, which, being south of the river Forth, was not regarded as part of Scotland nor the jurisdiction of St Andrews. In 1125, Pope Honorius II wrote to John, Bishop of Glasgow, ordering him to submit to the archbishopric of York. David ordered Bishop John of Glasgow to travel to the Apostolic See in order to secure a pallium which would elevate the bishopric of St Andrews to an archbishopric with jurisdiction over Glasgow. Thurstan travelled to Rome, as did the Archbishop of Canterbury, William de Corbeil, and both presumably opposed David's request. David however gained the support of King Henry, and the Archbishop of York agreed to a year's postponement of the issue and to consecrate Robert of Scone without making an issue of subordination. York's claim over bishops north of the Forth was in practice abandoned for the rest of David's reign, although York maintained her more credible claims over Glasgow. In 1151, David again requested a pallium for the Archbishop of St Andrews. Cardinal John Paparo met David at his residence in Carlisle in September 1151. Tantalisingly for David, the Cardinal was on his way to Ireland with four pallia to create four new Irish archbishoprics. When the Cardinal returned to Carlisle, David made the request. In David's plan, the new archdiocese would include all the bishoprics in David's Scottish territory, as well as bishopric of Orkney and the bishopric of the Isles. Unfortunately for David, the Cardinal does not appear to have brought the issue up with the papacy. In the following year, the papacy dealt David another blow by creating the archbishopric of Trondheim, a new Norwegian archbishopric embracing the bishoprics of the Isles and Orkney.
So in summary it appears that Malcolm III was more interested in Kingdoms than the reformation of the Church. The main driving force for the Gregorian Reforms in Scotland was Margaret of Wessex and the influence she had on hers sons. Edgar and Alexander began implementing the ideals of their mother but it was David who finished it, and in large part because of the marriages and wars he engaged in to unify Scotland under his direct rule and not that of the Mormaers. The fall of Scotland can be dated at earliest with the marriage of Margaret of Wessex 1070 and her unopposed introduction of the Gregorian Reforms, and the latest being 1130 at the death of the Mormaer of Moray Óengus and the subjugation of the Moray to the King of Alba.