This is a great shot to show a bird indulging in an activity or behaviour called 'sunning'. More than 200 species of birds have been observed to lie down on the ground and indulge in anting, dusting, or sunning behaviour.
Anting rids or reduces external parasites and can soothe skin irritations.
Dusting may reduce moisture, align feather barbs, and remove external parasites.
Sunning may help to increase body temperature.
Although you do not mention ambient temperature I do believe this to be 'sunning' and not dusting or anting. First I do not see any ants around on your photo which probably excludes that possibility. Secondly, if it was dusting then the bird would have wriggled around in the dust and it would be obvious to the observer that the bird were smearing the dust all over its feathers. Since the bird were lying still in this pose for ±5 minutes as you pointed out I would definitively consider this to be a case of a sunning bird. I am sure it was so enjoying it until you nearly gave it a cardiac arrest by touching its tail. No wonder it screeched and scolded at you as you would probably have done the same under similar circumstances (chuckle).
Well seen and captured in this interesting composition. Colours, details, and exposure control is all spot-on.
Well done and TFS.
Don't worry, It's not hurt. (12)