One of the better accounts of Peter the Great's life I've been able to find was written by a Scottish General, Alexander Gordon. However, I cannot seem to find any more information on him at all. The passage Gordon writes speaks of the Great Northern War, but even then that does not answer my question, as I can find no involvement of Scotland in that war.
Throughout the 17th and early 18th centuries, Scots were very widespread throughout Europe serving as mercenaries, either as regular soldiers or higher up positions like officers, captains and even generals. Sometimes they were officially endorsed and subsidized by the British government, but often not (to avoid potentially awkward diplomatic situations). This involvement first started in the early 17th century at the outbreak of the Thirty Years War, where thousands of Scottish soldiers traveled to the Continent to serve with various Protestant countries, from the Dutch to the Danes to the Swedes to other smaller German states (most notably the Palatinate, because of the dynastic ties between the Palatinate and the Stuarts in Britain). This was caused mostly by a lack of career opportunities back home in Britain due to the peace and stability that arose with the accession of the Stuarts to the throne of England, bringing an end to three centuries of near-constant conflict. Following the Swedish invasion of Germany in 1630, there were several prominent Scottish captains leading troops, as well as many regular Scottish infantry. The presence of Scottish mercenaries dropped off in the late 1630s into the 1640s with the advent of the British Civil Wars, with numbers dropping from thousands to only a couple of hundred [1].
In regards to the Great Northern War, the presence of Scottish generals and captains was because of, in addition to the same reasons listed above, Peter the Great of Russia's fascination with everything Western European, and his obsession with modernising the Russian army. Both his army and navy were staffed by hundreds of Scots and Dutch (the latter mostly for their naval expertise). Peter had great respect for 'Western' guests in Russia, and incentivised them to stay in Russia with both lavish gifts and estates, as well as high positions in the army. He paid them handsomely to instruct Russian generals, officers and soldiers in how to fight in the modern Western style, and many also accompanied the Russian army on campaign against Sweden in the Great Northern War, most prominently Alexander Gordon, one of Peter's most trusted and valuable subordinates. In the early 1700s there were so many foreign (mostly Scottish) men high up in the Russian army that it led to some discontent among native Russians, although it was worth it because they dramatically improved the state of Peter's army over several years [2].
The presence of Scottish mercenaries and instructors decreased in the 18th century as Britain became more directly involved (i.e. actually officially belligerents) in wars on the Continent, such as the War of the Spanish Succession and the Seven Years War, and so Scots had plenty of opportunities for military glory and career advancement serving their own country for once.
Sources:
[1]: Europe's Tragedy: A New History of the Thirty Years War by Peter H. Wilson
[2]: Peter the Great: His Life and Works by Robert K. Massie