Hello gmjkm: Welcome to PsychCentral… from the Skeezyks!

I hope you find the time you spend here to be of benefit.
From what you wrote it sounds as though, all things considered, you're doing pretty darn well. So that is to be celebrated!
As for the "playing out of scenarios" in your head you mentioned, what occurs to me is that perhaps this is simply a holdover from your youth. Over the years, pathways for this, became worn into your brain. So now it's simply sort-of a mental reflex, so to speak. It's probably similar to negative thinking. If one does it long enough, it just becomes a habit... sort-of like a car that's driving along in a rut & can't get out. Does that make sense? Of course that's just my layman's perspective. We here on PC can't diagnose you. That is a job for a mental health professional.
I think as far as your periodic episodes of depression go, it's difficult to know where this is coming from. Perhaps you have a genetic pre-disposition for it. Maybe it's a learned behavior... maybe both. The reality is there's no way to know. The important thing is that situational depression can, under the right circumstances, morph into a more long-term depression. So your tendency to fall into depressive states, when conditions are right, bears watching. If in the future you find yourself inching further-&-further in that direction, you may want to consider seeking some professional mental health services. For now, you seem to have a good sense of what it is that produces these states. So perhaps it's simply a matter of organizing your days such that you're less likely to become depressed. There's little or nothing to be gained by becoming ensnared in the mental health services system if you don't have to, in my opinion.
PsychCentral is a great place to get information as well as support for mental health issues. There are many knowledgeable & caring members here. The more you post, & reply to other members’ posts, the more a part of the community you will become. Plus there are social groups you can join & chat rooms where you’ll be able to connect with other PC members in real time (once your first 5 posts have been reviewed & approved.) Lots of great stuff! So please keep posting!