Sweet Itch also known as Queensland Itch is an allergic reaction to gnats and sandflies or other biting flies. The affected areas are painful and is made worse by rubbing and biting at the skin as your horse is doing and making himself bleed. As you described the areas most affected are the mane and tail.
Most likely what the groom has given to you to pour down the topline of your horse is Poridon which is a fly repellent.
You might try for a course of treatment is to bathe your horse twice weekly to remove crusts and decrease itching. A topical corticosteroid/antibiotic ointment will help to reduce skin allergy and infection.
I am sending you my best wishes and some