"Sometimes it does, sometimes it doesn't"

Solution 1:

This is an example of a rhetorical device called anaphora.

It's the very repetition of the word 'sometimes' that is emphasizing your point.

Unfortunately, rhetoric can sometimes be the enemy of conciseness; what you lose in conciseness, you gain (one hopes) in effectiveness.

Solution 2:

To make it absolutely clear, you can use

It happens sometimes but not always.

Solution 3:

You could reduce it by negating "always":

It doesn't always happen.

This implies that it happens sometimes, but it emphasises that there are times when it does not happen. The sentence accent will fall on always.

Or you could use "only":

This only happens sometimes.

This emphasises that the number of times it happens is limited. The primary sentence accent falls on some-, the secondary accent on only.