I think shower wait times very much depend on the time of day and the particular day you are travelling. I once took a shower and had to wait for a short amount of time (maybe 20min at the Al Mourjan North lounge) but that must have been more than 5 years ago. Arriving from LHR you will most likely not have to clear transit security, although depending on gate locations and your walking speed you might have to walk for a bit. So if you do the math: ~15 min walk to lounge, ~15 min walk to gate, ~ arrive 30 min before departure at the gate. This leaves you 30 mins to shower, even if you wait 20 mins, you still have 10 mins left. On the way back it's more tricky because you will potentially loose 5 mins from clearning transit security.
I suppose my point is: You should likely be able to get a (quick) shower even if you have to wait. But your margin is not large, in case of delays, wait times, etc. you will end up taking either a very quick shower or no shower at all. Of course, things look better if your gates are co-located and close to the lounge of your choice.
In terms of what you can do to improve chances: 1) As you pointed out, book a longer connection, 2) pack your running shoes and sprint to the lounge and to the gate (but on the way from the lounge to the gate don't sprint hard enough to neccessitate another shower, you won't have time for that!).