I cannot guarantee this information, but I've heard someone explain that the difference between kwenda shule and kwenda shuleni is a bit like the English distinction between "go to school" and "go to a/the/his/her/my/... school.
In English, at least, "go to school" without any determiner before the noun "school", gives two pieces of information: (1) the destination of the journey is a school (2) the subject is a student at the school and the purpose of the journey to the school is to learn there.
If there is any other purpose for going to a school, for example, to watch your niece in a play, to deliver a package etc., or if you are a student there, but you are going there on the weekend to meet your friend, you don't simply say "I'm going to school" (except as a joke), but "I'm going to the/a/my neice's (etc.) school." Dropping a determiner is a way of indicating that you're going to the school for its customary purpose. (We have similar phrases with "hospital", "jail", "church" etc., where "to [noun]" indicates not only the destination, but that it is for the customary reason.)
So, if the explanation I have been told is correct and I've remembered it correctly, kwenda shule is "to go to school (as a student, to learn)" and kwenda shuleni is for any other purpose, "go to the/a school".
I'd love it if a native speaker could confirm or deny or give some extra nuance or elaboration on that.