I'd say it purely depends on the content that the series brings forth and how long it stays focused on it's core plot. For instance, Hunter X Hunter is currently at 35 volumes, enough to be classified as a long running Shonen by the average measurement. Despite it's fluctuating quality between arcs, any less or being ended abruptly wouldn't do justice to the series with how much it's brought into it's world, the anime's conclusion showing that ending with it's initial core story wouldn't do justice to it's numerous plot threads. Whilst One Piece has decreased in quality by a wide margin since the timeskip and has been wrought with pacing issues, I'd say all the additional world building material to explore justifies it's length beyond the poor pacing of it's action.
As a whole though, Shonen tend to stick to far greater quality when limited to a mid/high-mid length of around 16-30 volumes. For example, Fullmetal Alchemist feels like very much of a complete package with little to criticise beyond superficial elements such as the humour and sticking to concluding with it's conflict against Father rather than extending itself needlessly is a core reason for such, ending with 27 volumes. Ashita no Joe is the best Shonen manga I've read and owes a lot of that to keeping it's story focused, not allowing any fight to seem unnecessary and having a solid ending with no need for continuation, wrapping up it's story beautifully after 20 volumes. That can't be said for series that kept extending itself needlessly, such as Dragon Ball offering a solid conclusion to most of it's arcs to the point at least six could have made a solid ending for the series (and should've ended no later than the Freeza Arc to preserve it's quality), Naruto constantly changing who the main villain seemed to be for the sake of needless extension or Hokuto no Ken retconning a lot of information in it's 2nd part, despite it's 1st part having one of the most solid endings in Shonen and Part 2 just recycling previous ideas and hyping up the legacy of Part 1 characters anyway.
There is one case where a series' extension beyond it's story's initial core can be considered fine, though. JoJo's Bizarre Adventure managed to stay in publication and avoid going stale by having each part have a different cast and setting. Mobile Suit Gundam also did this before JoJo, though the manga was merely rushed adaptions of the anime and the series lost it's justification for continuity when it started making alternate universe spin-offs that lacked or even contradicted the core ideals of the original U.C. continuity. I wouldn't mind seeing more Shonen utilising this method to excuse extending their run, or least change up it's cast if the main conflict is one spanning generations much like the Chinese epic Romance of the Three Kingdoms.
Tl;dr There are ways to excuse extending a long running Shonen, but very few utilise it and keeping a story relatively short and focused is usually the best option.