Sounds like you just need to build the right reflex. This takes time, and unfortunately the older you are the longer it can take.
Make sure to start slowly when you're training. Slow is smooth, and smooth is fast. It's when you try to go faster than your level that you do it wrong, and that's when you'll get hit.
Regarding doing the repetition for this, there's three things that I recommend.
First: Just practice the blocks. I'm assuming you're already doing that, but it's worth mentioning since that's the most common one. When I learn a new technique that I like, I'll practice it all the time - I'll do it while I'm walking around my home, while I'm bored at work, I might use the kick or strike to open doors, things like that. The more you practice, regardless of context, the more engrained it'll get.
Second: Shadowbox. and shadowbox intelligently. This means that when you do it, don't just throw punches, make blocks, throw other punches. Imagine that there's someone throwing the punch at you, visualize them and visualize your block. Again, you can go slow with this, you don't need to get this at full speed tomorrow, or even a month from now. The important thing is just practicing visualization and the correct responses.
Third: If you've got a significant other or close friend who are up for attacking you, use them. You're right that it's easier to practice with a partner. They don't have to actually be throwing strikes well, so long as the strikes make sense. I'd recommend doing something like choosing 3-4 strikes a day, and have them rotate between which one they throw randomly. This way you only have to think about a few strikes/blocks each time, but still have to react to the right one. Then switch to different strikes the next day, and the next...and when you're good start increasing the number to 4-5 strikes, then 5-6, etc.