The Film of Soot on the Fireplace's Grate (The "Stranger")
In the England of Coleridge's time, people used to use fireplaces a lot (this was the late eighteenth century after all). Sometimes a film made of soot would form on the grate of the fireplace and stick there, fluttering. People called it a "stranger" and it was believed to betoken the arrival of an unexpected guest. Coleridge plays with this idea in the poem, stating that when he was in bored school and saw that a "stranger" had formed on the classroom's fireplace, he would imagine that it signaled the arrival of one of his family members or friends. In the poem, he uses this to suggest the arrival of a more heavenly visitor—like God. Coleridge also compares the "stranger" to his own mind and thoughts, since they're both the only things moving in the night.
Lines 13-18: When the "stranger" first appears Coleridge suggests that it has "dim sympathies" with him, since they're the only two things awake. Also, the motion of the fluttering "stranger" can seem like the motions of thoughts as they rise and depart (the same way you might imagine thoughts as waves, cresting and subsiding).
Lines 24-27, 37-44: But, in the next two mentions of the "stranger," it doesn't remind Coleridge of his own mind; it makes him think about or anticipate someone else. But the "stranger" hints at more than the arrival of a relative, paying him a surprise visit him in school. The stranger hiding in Nature, waiting to appear, might actually be God—since Coleridge turns his attention to God, shortly after this part of the poem.