In response to your question about the loss of Mossgiel Farmhouse:
You are correct in stating that the loss of the Mossgiel farmhouse was a contributing factor that inspired the poem To a Mouse.
The reason for this, as your question stated, is that at this point Burns had felt that there was nothing further to live for. He, as the mouse, are now "homeless", dragging through the dirt, wondering for scraps, and living for the day. In fact, this poem did not become popular until after his death.
Thy wee bit housie, too, in ruin!
Its silly wa's the win's are strewin':
And naething, now, to big a new ane,
O' foggage green!
An' bleak December's winds ensuin'
Baith snell an' keen!
The industrial revolution had added an unwelcome reality check to the Romantics, and its onset in society made them quiver to think what lays ahead but a bleak, dry future. Burns knew that, particularly his future would be bleak.
I'm truly sorry man's dominion
Has broken nature's social union,
An' justifies that ill opinion
Which makes thee startle
At me, thy poor earth-born companion,
Hence, the mouse represented his current condition, not knowing where to go, nor where to hide. Yet, according to Burns, the mouse was still better off than he, due to the fact that the mouse does not have to face his own demons, and his own reality the way Burns does.
But, Mousie, thou art no thy lane
In proving foresight may be vain:
The best laid schemes o' mice an' men
Gang aft a-gley,
An' lea'e us nought but grief an' pain,
For promised joy.
Finally, he also compares the mouse's luck to his in that, just as the mouse does not have to see his future, he doesnt either have to remember is past.
Still thou art blest, compared wi' me!
The present only toucheth thee:
But, oh! I backward cast my e'e
On prospects drear!
An' forward, tho' I canna see,
I guess an' fear!