Disclaimer: This is all based on my subjective experiences, so it might not apply in your case. But I still think it was an interesting topic worth mentioning.
One of the things I quickly noticed once I started working on Dreadhalls is how different making a horror game feels, when compared to the more traditional games I had worked on in the past.
For once, gameplay mechanics tend to take a secondary role when compared with theme, ambience, and immersion. And those remaining mechanics, at least in my case, have to do less with fun and much more with making the player feel underpowered in different ways.
But there is another more subtle difference I wasn't aware of until I had already spent quite some time working on this game: making horror games can also be psychologically taxing.
Like in many other creative processes, there's a research phase involved in making this kind of games. That is, making horror games often involves researching horror.
So, you will have to look for references by searching for things such as uncanny pictures, creepy stories, or even real world horrific and disturbing stuff. And where most people would leave it at that, once their curiosity is satisfied, as a developer you have to keep going deeper, examining and analyzing and contrasting dozens of instances of these.
You might intellectually know most of it is fake and it's just designed to scare you (same as when you are watching a scary movie). But in the end, many of these things work at a subconscious level – that's how they are designed to work, after all! - and will bypass most rationalizations.
Even when looking at your own game and playing it, you will often actively try to forget what you know about it, stop analyzing it as a developer, and do your best to focus in feeling the same fear and horror a new player would, since you need to look at it from that perspective in order to know which parts work and which don't.
The sum of all this over time can result in experiencing a certain level of uneasiness, scary thoughts, nightmares, etc... This of course will be very different depending on context and other factors. For instance, the experience of a single indie developer working alone in an otherwise silent house might not be the same as that of someone working along more people in a busy studio.
Another effect of this could be a negative impact in the quality of the game you are making, specially if you don't wish to research certain topics, or playtest some parts of the game because of the natural tendency we all have to avoid unpleasant experiences.
While I think experiencing fear and uneasiness is not something to avoid (you are making a horror game after all, so you should eat your own dog food!), there might value in stopping those feelings to dominate the time you spend developing the game. That's specially true when you are working in things such as bugs, technical features, etc... that don't require you to experience fear, but still require you work with disturbing material.
With that in mind, here are some strategies I think can help with this:
Removing disturbing material:
Sometimes you are just looking at a bug in the environment scenery, and don't really need to be jumpscared by a random monster (or feel that fearful anticipation that comes before a jumpscare). Disabling these can reduce your exposure and give you a safe place to work with. You should be careful, though, since you still need to keep playtesting the game as the players will see it!
Listening to music:
If you are programming in an empty house, specially after playtesting your game or doing some research in horror, it's very easy to pay too much attention to random natural sounds here and there (wood creaks, water drops...). Music will cover those and help you focus again.
Like with the previous point, you should be careful and not use music when playtesting, since a large part of horror depends on sound and you should be able to hear it.
Taking a walk outside, and going to a park during a sunny morning is probably the best antidote against those feelings of uneasiness you might experience. It will root you back to reality. Plus, it's a healthy habit to have.
Just try not to go to that creepy forest at night, as that might not be so effective.
The more you experience and learn about fear, the more you will understand how it works. If you are able to analyze it, you will negate most of its effect. You might still get scared, but you should be able to act rational even when in fear. Keep your emotions balanced, and its effects won't last that much.
Remember, fear is the mind killer.
If you have worked in this kind of games and have more recommendations, I'd love to hear them! Feel free to use the comment section to post them, or to share your own experiences when developing horror games.