How does the relationship of the Church of Scotland to the state differ from that of the Church of England? Both England and Scotland have "state churches", but what exactly does that mean? How did these special relationships between a church entity and a sovereign state come about and how specifically do the two states/churches handle their relationship differently?

I'm particularly interested in how the Church of Scotland came into it's current position and if any part of the process was directly influenced by (either modeled after or in opposition to) the status of the Church of England at the time.
The Church of Scotland is not a state church. It is recognised as "national church", but it is independent of the state in matters spiritual. The Church of Scotland and the Church of England have very different histories - it is not a question of one trying to imitate the other.

The Scottish Reformation of 1560 took place when Scotland was still a separate state. The Reformation was recognised by the Scottish Parliament. A long struggle between Episcoplian and Presbyterian factions ensued; Presbyterianism was finally recognised in 1689-90. The Treaty of Union between Scotland and England in 1707 also guaranteed Presbyterian church government within the Church of Scotland. State intervention, however, proved problematic and was a contributing factor to the "Disruption" in the Church of Scotland in 1843 (over the right of appointment of ministers). To help secure the reunion of the majority of the United Free Church of Scotland and the Church of Scotland in 1929, the British Parliament recognised the "Articles Declaratory" of the Church of Scotland as lawful (by the Church of Scotland Act 1921). The Articles Declaratory express the Church's self-understanding as a national church, yet independent from the jurisdiction of the state in matters spiritual.

Bishops in the Church of England are (technically) appointed by the Queen. "Measures" of the Church of England's General Synod are subject to Parliamentary approval. There is no such state appointment/ratification system applying to the the Church of Scotland; the General Assembly is the Supreme Court of the Church of Scotland - the Queen may observe (or send a Lord High Commissioner in her place); the "throne gallery" is formally regarded as being "outside" the Assembly Hall.