You were right to stop at a safe place. Having done that, I would have stayed there.
If I was going to carry on, I would have not stopped and carried on, noting the reason on the back and not making a habit of it.
Having done what you done, it’s too late to worry about it, just make sure that your version of events is the same as the employers should you need to explain.
“Stopped at safe place due to running out of driving time. Moved from safe place as I heard a load of neds at the back of the lorry, got out to see what they were up to and they tried to chib me, so I got out of there quick and back to depot on grounds of personal safety”