Rivals usually fall between two categories:
Competitive prick or
Friendly punching bag
Obviously some rivals display traits from both of these sides. Rivals like Blue and Silver are on the left side of the spectrum, while meanwhile characters like Brendan/May and the Gen 6 group fall on the far right. But there are rivals like, for instance, Hugh, Barry, and Wally that fall into varying degrees in the middle of the spectrum.
This isn't to say that a certain side of the spectrum is necessarily better. The thing about opinions is that every person has a different one. Some people prefer the love-to-hate rivals like Blue, taking pride in beating them. While others may prefer the friendly rivals that actually act the role of "childhood friend".
The thing about rivals is that their effectiveness depends on the narrative. Having an extremely-happy rival that always tries to help you out may work a lot better when you have a serious antagonistic force. Having someone reliably fight alongside you in times of need can give a nice feeling of closeness. I personally found Hau far better than the rest of the friend archetypes, particularly because he's a bit self-aware that he's weaker than you. But he still helps you in multiple instances.
Rivals are really one of those cases where "it depends". In my personal opinion, a rival should have depth to them, at least. Blue as a rival, despite being an excellent obstacle, has little depth as a character and, despite being a 'childhood friend', acts more like a snobbish bully than anything else. Personalities aren't formed out of thin air, and a solid reasons and motivations should be given to have your rival act the way they do. In my opinion this is what can make a rival either work, or not work.
But there's still the fact that rivals should grow alongside you. This isn't just the sense of having a stronger team, but having them learn things about themselves or the world around them through their journey. Silver is undeniably one of, if not the most developed rivals in the series. He has a solid motivation, strong determination to reach his goals, yet ultimately realizes that his methods aren't the right way to go. He eventually comes around and starts treating his Pokemon as equals, becoming a much stronger trainer in the process.
In a game that isn't very heavy in the plot-department, Silver works well in being able to act as both an obstacle and a character that you grow to genuinely like over the course of the game.
This doesn't have to be limited to rivals softening up of course. For instance, an otherwise carefree could be hardened by the world around him. Obviously, in cases like this, you want to give reasons why he does what he does. A happy, lighthearted plot with not even a hint of dark themes should not turn your happy-go-lucky best friend into an edgelord. Every good development requires something that challenges what they think. Views are shaped by experience, and a solid experience, good or bad, can completely change how you look at things. The same should apply to your rival.
... But enough of character talk. You want your rival to at least put up a fight. If your rival likes to boast, give them some bite to back up their bark.
- Make their teams balanced, with good type coverage.
- Keep them a notch above the trainers around you. They're your rival for a reason. What's the point in having them be just like any other trainer?
- Having strong Pokemon never hurts, but it definitely does when it's your rival using them.
- Rivals rarely ever make use of held items. Using them could help mix things up a bit and give them more of an edge.
In terms of making them an actual roadblock however, there's plenty ways you can do it.
- Have them block off an area, maybe until you have a gym badge. This can either be because they think you're not ready, or you're not good enough.
- In between major encounters, maybe you can give them an optional battle or two to show some progress.
- Place them in front of your destinations. Blue was good about this: the SS Anne, the road to Bill's, even the champion room itself. Blue was always protecting an area essential to plot advancement.
- It's always good to have your rival be the final challenge before the Pokémon League. There's a reason almost every game in the series has done it.
- If you really want to be a prick, you can put them at the end of a long route. Having a worn out team can have your rival put up an even bigger fight
These words exist only so that I can get to 800 words without actually thinking of any more things to say.