Given these categories as data beyond my control, I would code
4 Don't know
on these grounds:
Sometimes sounds weaker than Yes, which is more emphatic.
Don't know doesn't usually belong in an ordered sequence.
Then some analyses will call for ignoring 4 and some don't. All depends on the question being asked: for example, are you describing the data or modelling?
But I think it's wrong to call "Don't know" missing. We all answer questionnaires too. If I am allowed to say "Don't know" as one of various possible answers, that is not at all equivalent to my refusing or declining to answer the question. As an occasional survey participant as well as a statistically minded person I object to data being analysed like that.
There is no case for calling this variable continuous. It's discrete. 1 to 3 alone is ordered, 1 to 4 is just nominal or unordered.
A context of logistic regression doesn't change how you think about the variable, unless it is being considered as a response and you are choosing between ordinal and multinomial logistic.
Thinking more about this, it's hard to see that "Sometimes" and "Yes" are mutually exclusive! What are the questions? Do you ever eat meat, drink alcohol, smoke tobacco?
There is a separate problem if people were presented with these answers in this order:
2- Do not know
Then it's entirely possible that, rationally or not, some people might regard that as an ordered scale. For example, "Do you approve of the behaviour of prominent politician?". There is something of a case for saying that "Don't know" is in between the extremes, as in "I don't know enough or don't want to be judgmental about the topic". But then people are being expected to know the difference between "Don't know" and "Sometimes". That can happen: I had no idea what was involved in a minor medical condition until it happened to me and was named and explained.
Without qualitative evidence about how the questionnaire was received or understood, it's very hard to do more than speculate.