Well, to answer your 1st question, I think older nurslings nurse for all the reasons you mention and others as well. There is no reason to think it is not sometimes for hunger and thirst, but certainly closeness, comfort, to 'have something to do" and for help getting to sleep becomes more and more the prime motivation...
As far as nursing at bedtime-For us a big shift began when we made nursing part of the night routine but stopped having it be the final thing...after getting into pjs, story, etc, I would nurse my son, but then my husband would take him into his room (we had stopped co-sleeping in the beginning of the night before this-at about age 3 or so for both boys. The kids were welcome to come into our bed later if they wanted) and rock him to sleep or sit in his room & sing a quiet song or tell a quiet story until he fell sleep. I figured out he could get to sleep on his own during naps before this-First I prepared him all morning for the idea of 'quiet time in his own bed." Then when nap time came, he nursed, then I put him to bed, told him he did not have to go to sleep but had to be quiet for quiet time, and turned out the light, darkened the room with dark curtains and put on a white noise machine and went out. This was when he was about 3.5...The first day he whimpered a bit for about 5 minutes and I felt awful and was about to give up, but then he feel asleep! He must have been ready because it worked great after that. So after that I felt confident he could fall asleep gently without nursing and we started having his dad do the final bed time step and eventually he also could leave the room before my son was totally asleep.
I really forget how we ‘finally’ came to an end to nursing with my oldest, but besides the lessening of the sleep association we did above, I had also for some time been limiting nursing sessions to 3 X a day (morning, naptime and bedtime) with exceptions for emergencies like owies and hurt feelings. I had also done other things, like limiting the length of sessions-agreeing to nurse but for a count of 20 or the time it took to sing a song. That made me able to say yes but still put a limit on it. I agree it can be counteractive to say no all the time, but setting limits is helpful, and there are many ways to do that.
Oh and fyi we found that getting our boys up to pee at our bedtime (so, about 2-3 hours after they went to bed) helped with the transition out of nighttime diapers. It’s pretty normal for wetting at night to go on longer for boys than girls, especially if your son is a heavy sleeper.