Okay, now to the coding part.
"Has anyone had a similar experience and managed to push through the mental blocks associated with learning to program while having your own mind constantly working against you?"
All the time. I have the depression, and a few other mental problems most likely, and I have to say, for as much as my brain helps me it hurts me a lot too. Especially with programming and engineering, I feel like things are impossible right up until there's some breakthrough, and then things are fine. It happens really quickly, and soon you're just onto the next problem - many times I feel I don't relish the victory of whatever I have solved enough before moving onto the next thing. You might be doing the same thing too - I can't tell how much or little progress you've made, but learning is hard, and it makes everyone feel dumb, not just you.
"I can manage to throw together bash scripts and other glue that's necessary to make automation tasks function at my work, but these are largely cargo culted from various stack overflow posts or other online resources" This is more of the job than you'd think. I honestly think you're on the right track here.
As a sysadmin, are you good at debugging other people's code when something breaks (do you try? sometimes there's org boundaries that prevent this)? That is also a hugely valuable skill. I know some people who are frightened of writing code fresh, but are great at finding and fixing bugs.
I'm not sure this will be of much help, but I also think as a society we're all about fixing our problems rather than leveraging our strengths. If coding just doesn't click with you, that's fine, obviously other tech things do click with you. Keep working on finding what works for you.