I've had mild issues with my peroneal tendons twice before and both times they have cleared up within 2-3 weeks when I have easily jogged through it. Like I said before though, this is just my experience and you may be different.
Regarding your question about the barefoot running and the pain disappearing, the easy answer is yes it did disappear. However the slightly longer answer is, yes it did disappear but not right away. Taking off my shoes has never miraculously cured any of my injuries, the only reason I do it is so that I can run a bit more naturally and there is no outside force acting on my legs while I recover. I believe it's the mechanical component of the easy running that helps heal, not the shoes or lack of.
The biggest thing I should say though, is that I have never had an injury so bad that running has been excruciating. I'm not sure I could bring myself to run through a really bad muscle tear or a stress fracture, plus I'm not sure it would be wise. Sure, those easy 10-30min jogs can be pretty uncomfortable, however I'm never in so much pain that I start limping or really getting scared I am doing permanent damage.
If It were me, I would:
A: Go see a medical professional, a physiotherapist has always been where I go. Listen and do what they say (the physio I see tends to agree with my easy jogging medicine)
B: Go for some super easy jogs on grass. If barefoot feels better, go barefoot. If it doesn't feel better then don't run barefoot. Not everyone is able to run in barefeet as easily as others.
C: Once you can run 30 mins pain free, try 45mins then an hour.
D: I would do the 8K race, but only if it more important to you than a fast recovery.
**Disclaimer**
I am not an expert and I am in no way a great runner. My last 10km was only mid 33 so you can take what I say or leave it.