Without having seen it, it is also possible it was grooming behavior and the horse was trying to make friends with you. Nibbling at clothing is a thing horses do and it can be disconcerting if you’re unfamiliar with them. It’s not something I would let a horse I had the charge of do to a stranger because of that…it might be polite and friendly in horse, but they need to be gently but firmly informed that it’s rude in human. I would have had to be there or see a video to properly explain it. Mostly, you look at the position of the ears. If the ears are laid back, it’s either aggression or fear. If they’re forward and pointed at you, it’s a horse that hasn’t been taught that some humans don’t care to be greeted that way.
It can get even more interesting if you have long hair. I’ve had more than one horse tug my ponytail to get my attention. They get told off because again, it’s rude. I’m pretty sure tail/mane tugging is kinda rude in horse too…