Would something like this work? Say, put it at the very top of category_view and the forum templates?
<p>Sorry, too many users online, come back later!</p>
<%else%>
(Your normal category/forum view code here).
<%endif%>
Code:
<%if users_online > 5%> <p>Sorry, too many users online, come back later!</p>
<%else%>
(Your normal category/forum view code here).
<%endif%>