Any event like this requires consent from the local authority and in the case of competitive events, police approval too under the Cycle Racing on Highways (Scotland) Regulations 1960 (similar legislation exists in rUK)
Full risk assessments have to be carried out for those parties and also for the regulatory bodies (usually British/Scottish Cycling or British Triathlon in this particular case). This is to ensure events are operated to a high standard and also because those bodies usually provide the insurance requirements.
These Risk Assessments include sign and marshal placement which must be adhered to.
As a result, most events are incredibly well run. What you cannot legislate for are peoples stupid actions as in this case.
The fact it occurred during a triathlon event in some respects isn't relevant. These idiots could just have easily been on a training ride or club ride. So to call for greater regulation or a ban on events on public roads does not solve any problem. Getting roads closed for an event is a logistical nightmare and very expensive, generally receiving greater opposition.
Cycling events whether racing or not have taken place safely on open roadsfor well over 120 years, even in the period of car domination from 1960s onwards. There are hundreds of events that take place every week up and down the country with no issues.
What is comforting in this case is that the Horse Riding community appears to understand this incident is not reflective of all cyclists and that we share similar dangers as vulnerable road users.
I think Human Race's response has been the right one and hopefully these morons will be identified, helped by the fact this was an organised event.