Translation:Sometimes I sleep while I work.
Just in my experience, I've noticed this seems to happen whenever something precedes the pronoun+verb. So to use a song lyric as an example, you have: "JEG VISER dig verden" (nothing in front of it), but "hvis du går med mig, VISER JEG dig verden" (clause in front of it). Here you use "sover jeg" because you have the adverb "sommetider" in front modifying it. Does that make sense?
In Danish and other Germanic/Scandinavian languages exists V2 word order.
"In syntax, verb-second (V2) word order is a specific restriction on the placement of the finite verb within a given sentence. The V2 principle requires that the finite verb (the verb which is inflected for person) appears in second position of a declarative main clause, whereby the first position is occupied by a single major constituent that functions as the clause topic." https://en.wikipedia.org/wiki/V2_word_order#Continental_Scandinavian_languages:_Swedish.2C_Danish.2C_Norwegian.2C_Faroese
Or, in other words, when you want to emphasize "sometimes" the verb must remain in the second position, pushing back the subject behind the verb. Clackdaniels described it perfectly.