You asked for it, J...
Self was originally an adjective but later became a noun and a pronoun. It was unconnected syntactically to the word it related to - I, you, he etc - self being a nominative in apposition to that subject. As regards him self - which first appeared as two words in the 890s AD, the word him was not in the accusative case, but in the dative; that is. it implied ‘for' or ‘as to'. In other words, him self was saying, in effect, "the man as to himself". We see the same idea today when we say, "He is the very man who..." with ‘very' meaning much the same as ‘as to'.
The reason it became one word, himself, by the early 16th century was because the very closeness of the two words used constantly in this way simply DREW them together.
Originally, myself - recorded as early as the 850s AD - was meself with an ‘e'. As with the ‘him' above, the ‘me' was a dative form (for/as to). Thus, in ‘ic me self' - I myself - we have the I as ic (cf modern German Ich), self in apposition to that and me as the dative form.
Miselven was recorded in the 14th century, my self (two words) in the 15th and myself (one word) in the early 18th. The reason it changed from meself to myself was because of the unstressing of the vowel ‘e'. Presumably it went through a phase of being pronounced roughly as misself, so myself seemed like a reasonable spelling.
Both words, himself and myself, went through a typical process of evolution and simplification, just as so many other words have over the centuries.