I think a good "out" would have been introducing Thomas Riker, his transporter clone, earlier in the series, and either writing William Riker out of the show as finally getting a command and having him choose a ship over Troi, or killing William Riker off altogether, and have Thomas Riker "join" the cast.
Then you would still have Riker on the show, just a different version of the character, with more room for character development, the "second chance" for Troi to have a relationship with Riker would make sense, plus you wouldn't have the problem of someone who should be a captain, hanging around as "co-Captain" of the Enterprise.
Definitely would've been a great idea! Will became rather stale (or in Troi's words, "matured")--I mean, his approach became more "cautious," less career-oriented...predictable. There wasn't much that could be done with him anymore. Tom, on the other hand, would've brought more mystery, more options, more exploration that also would reflect on could've-been for Will. They did waste Tom.
As for jerk or not? I'd say he was cocky in the early seasons, but understandably so, I suppose, with youthful ambition/vigor. But later, it came across more as bitterness with himself (bitterness that extended to lack of tolerance for others not in his clique).
I didn't think Riker was a jerk at all (well, except maybe to Troi, as I explain later). In fact, as a character, I liked him and glad he stayed on the show. That said, the problem is that Riker was INITIALLY portrayed as an ambitious, up and coming prodigy officer who was supposed to be on the fast track to Captain, and whom chose between career and Troi, prior to taking the assignment aboard the Enterprise. Then he stays on as first officer for 15 years for not one, but two Enterprises...nearly an entire career! Totally inconsistent with his character.
Now, it could be argued that he stayed, at least in part, because he was hoping to re-kindle something with Troi (which he did...just took him like 12 years to do it!), but pretty much all through the TNG series, he treated her like a doormat, and rubbed in her face his women of the week. So if he stayed for Troi, and unless they were swingers or something, it was written pretty inconsistently, and in-universe, was pretty sadistic of him.
This is why I am a fan of the idea that never will be, that Tom Riker should have replaced Will Riker in season 4. It literally, and no pun intended, was the best of both worlds: you could keep Riker AND Frakes on the show, yet do it in a way that could expand the character. After all, Tom Riker literally IS Will Riker. Also, with Will Riker gone, that would have automatically made Data First Officer, and it would make total sense to have Data as first officer indefinitely. Unlike Riker, Data would not have the ego to bruise or human ambition and could conceivably be content as First Officer for decades. After all, Data was supposed to be the longest serving starfleet officer aboard the Enterprise-D, after Picard, was he not?
One last thought: I could not stand Shelby! At all. Her ONLY purpose was to demonstrate that Riker had become too comfortable as First Officer and needed a fire lit under his ass and step up to the plate in BOBW. That's it. She was not intended as a replacement, and I think it ironic Riker gets a rep for being a jerk by all the Riker haters, yet Shelby gets all this love by some people for some reason. She was a total jerk...way worse and way more cocky than Riker ever was in his worst episode. Had she replaced Riker, I think it would have completely changed the dynamic of the cast and show...and not for the better.