Marx did not write much about the state because he mostly was focused on analyzing and critiquing capitalist society in general and capitalist economy in particular. What he wrote on the state was mostly related to how it functioned to uphold a capitalist economy, e.g.
The executive of the modern state is nothing but a committee for managing the common affairs of the whole bourgeoisie [1]
What he did write about a post-capitalist state was typically ambiguous. In The Civil War in France he wrote that
the working class cannot simply lay hold of the ready-made state machinery, and wield it for its own purposes. [2]
However Marx advocates what is called "the dictatorship of the proletariat", i.e. working-class democracy.
We have seen above, that the first step in the revolution by the working class is to raise the proletariat to the position of ruling class - to win the battle of democracy.
The proletariat will use its political supremacy to wrest, by degree, all capital from the bourgeoisie, to centralise all instruments of production in the hands of the State, i.e., of the proletariat organised as the ruling class; and to increase the total productive forces as rapidly as possible. [3]
The "dictatorship of the proletariat" is a confusing term because to modern readers dictatorship refers to a single executive power in control, but that's not how it was used in Marx's time. It would have simply been understood as worker's democracy. [4]
To get closer to your question, though, in Neue Rheinische Zeitung No. 136 Marx wrote that
there is only one way in which the murderous death agonies of the old society and the bloody birth throes of the new society can be shortened, simplified and concentrated, and that way is revolutionary terror. [5]
It's unclear what he meant by revolutionary terror because the word cant be understood in the same way we understand terrorism today, especially in the context of the rest of that article. "Revolutionary Terror" no doubt has its origins in the French Revolution's Reign of Terror so it's unclear what Marx specifically meant by this term; terror against one class, individual terror, general civil war, etc. In the context of the article it seems to be justified as self defense against reactionary elements killing workers.
However Marx "felt that terrorism was likely to be counterproductive" [6]
As for purges and personality cults its unlikely Marx would have supported either of these, he was fiercely individualistic, politically favored proletarian democracy, and as a communist opposed class-based governments and economic hierarchy.
The working class, in the course of its development, will substitute for the old civil society an association which will exclude classes and their antagonism, and there will be no more political power properly so-called, since political power is precisely the official expression of antagonism in civil society. [7]
[1]https://www.marxists.org/archive/marx/works/1848/communist-manifesto/ch01.htm#007
[2]https://www.marxists.org/archive/marx/works/1871/civil-war-france/ch05.htm
[3]https://www.marxists.org/archive/marx/works/1848/communist-manifesto/ch02.htm
[4]https://www.marxists.org/subject/marxmyths/hal-draper/article2.htm
[5]https://www.marxists.org/archive/marx/works/1848/11/06.htm
[6]https://books.google.com/books?id=VV6SCsBesVgC&printsec=frontcover#v=onepage&q=marx&f=false
[7]https://www.marxists.org/archive/marx/works/1847/poverty-philosophy/ch02e.htm#3b
To add to this how different were Lenin and stalin's ideals and policies?