Your deer flies are back out again? The only thing you can do about them, I think, is bug dope. I use this https://www.amazon.com/Farnam-Roll-Repellent-Horses-Ponies/dp/B00061MSI0 It's a roll on so I can control exactly where it goes. It works. My Vet is not keen on it, even though the main ingredient is all natural pyrethrim it is still an insecticice. She encouraged me to try a Doterra essential oil blend. Terra shield but the deer flies died off so I have not tried it. https://www.amazon.com/doTERRA-TerraShield-Essential-Repellent-Blend/dp/B004O291IM Oban was badly bitten one day, (I'd forgottne to take my bug dope) both eyes swelled up and blood was running out of the puncture bites those damn deer flies left in him. I would not expect good leash or any kind of behaviour when they bite that badly.
Oh, poor boy, those flies are obviously bothering him. I agree with @Snowshoe that's it's pretty impossible to expect any nice walking when he's being bitten. I think you both did remarkably well. If it were safe in that situation, I'd let my dog off lead so as not to risk any chance of developing a negative association with being on lead or at heel, but appreciate that may not have been possible where you were.