Unwanted interactions when travelling solo - your experiences and advice?

Sorry this is a long (maybe pointless) debrief but I just wonder if there is something I should have done differently or I suppose if anyone has insight to why this happened/ what the end game was. And interested in hearing your stories too!

I (30F, white as feel that might be relevant!) was solo at Batu Caves, Kuala Lumpar when a Malaysian man (40-50 years) came up to me, very friendly, and asked where I am from. I told him UK but didn't really want to engage more so just smiled and made to move on when he asked me to take a group photo.

I thought he meant of him and a group he came with so suddenly feeling like I understood why he approached me I said yes enthusiastically before realising he meant the two of us! I felt too awkward to back out then so we did the photo.

I was then sort of stuck with him on the steps, if I climbed he came with me and if I stopped he stopped. I had a rucksack with me which he offered to carry but I politely declined. He asked me my age (i tried to brush it off with asking what he thought and he said 18 which is ridiculous but also made it feel a bit more uncomfortable) and then when I said I was quite a bit older he asked if I was married. Again I tried to laugh it off as I was feeling quite uncomfortable and told him I was too busy with work and tried to change the subject by asking what he did for work and he just said business and when I asked a bit more he just smiled and shrugged and went quiet.

By then we were at the top and he walked off so I thought I was free but a minute later he came back with a drink and some popcorn for me. I tried to decline but he really insisted, saying he wanted to give me a gift as a visitor to his country, so I just accepted.

I was watching a blessing from outside one of the temples and he was just smiling at me so I asked if he knew anything about what they were doing. He looked to be of Indian descent and I thought maybe this was his aim to guide me around the caves and then ask for a tip and I was willing to just to go with it, especially as I felt obliged to give him something because of the drink. He just smiled and shrugged again and offered to take my picture on my phone. I don't think he would have stolen it or anything but I wasn't comfortable handing it over so I just said I was too sweaty for a photo (not untrue haha!).

He then just followed me around, not really saying anything and I didn't engage him. At one point I turned round and thought he was filming me but not sure so didn't say anything.

After about 10 mins he offered to take my photo again telling me I looked pretty and I said it had low battery so he said he would take more on his phone and asked for my WhatsApp. I said no thank you and he started to get really insistent that he wanted my WhatsApp. Almost begging, saying how beautiful I am (I am average), how much he likes me and wants to keep in contact.

I said I was leaving Malaysia today thinking again maybe he was after my business for something but this didn't deter him. He was still smiling but repeatedly asking why I wouldn't give him my WhatsApp, what's wrong with sending messages, did I not like him etc. I just kept saying no thank you and walked away (I saw an elderly white couple at the top of the stairs and was prepared to ask to join them if he didn't leave me alone).

Thankfully he didn't follow but then annoyingly I got attacked by the monkeys at the top of the steps because I had rushed over there stupidly still holding the bag of popcorn and then it was a right nightmare trying to get it in my backpack while they tried to jump/ climb on me! 😂

Because of this I spent about 20 mins total at Batu Caves, monkey scratched my leg, I took no photos other than one awkward one at the bottom, and left feeling really flat and uncomfortable. In retrospect I should have cut things off earlier but I'm not really sure how I could have done this.

What experiences do you have of this sort of thing when solo travelling? What should/ could I have done differently? Was there more to it than I realise or was he just being friendly?