At the end of the main quest, it's clear that Haermeus Mora replaces Miraak with the Dragonborn as his new toy.
I didn't want to end like this; yet I wanted, somehow, to end the main quest and free Solstheim from Miraak influence. So, I started to study the scripts and the variables that control the game. I wanted MY ending to be permanently recorded into the savegame files, so MODs weren't the answer to what I was looking forward to do.
It should be noted that I already glitched my way out of the mage guild quest, so the old archmage is happily studying the eye of Magnus, I'm not forced into Labyrinthian chasing ghosts and I'm content being but a minor member of the guild, my character main focus being to carry on a life as an adventurer, sellsword and rogue. All of this, without having the journal cluttered with unfinished quests.
But I'm digressing... What I did in Dragonborn was similar: I had learned the first two words of power for the 'Bend will" shout, but when I gave the Black Book to Storn, I used the console to glitch my way out of the final quest. Haermeus Mora still kept his end of the bargain, in exchange for Storn's life and secrets, by teaching me the last word of power. Then, using the console a bit more, I could finish clearing Solstheim of Miraak influence by restoring the last stone.
What happens next? I can only pretend to know the answer.
The Skaal are happy and Frea is the new shaman. I'm sure Miraak, by now, knows who sealed him back into the Apocrypha. Haermeus Mora gained some knowledge but he won't be able to use me as he did with Miraak. At least he will find creative ways to punish his pupil for having tried to escape. This ends my involvment in Dragonborn main quest. Now I can happily explore Sosltheim in pursuit of new adventures free from another annoying Daedra. No thanks, I pledged my sould to Nocturnal already. Go away, you freak octopus!