"-ni" is the locational suffix, meaning on, at, or in something. So "shuleni" literally means "in school." It is often used in phrases like this showing direction. "Nenda sokoni" (go to the market) or "nenda nyumbani" (go home) would be other examples.
Could it be because 'nenda' - go (you go, in this case) - is in the imperative, and '-enda' (kuenda) is part of the verb root?
Yep, nenda is one of the few irregular imperatives. There's also njoo ("come", not kuja) and lete ("bring", not leta).
In areas away from where Swahili is spoken as a native language, and particularly in Kenya, you might hear regular forms of these: Enda, Kuja and Leta.
My undrstanding: 'kisha' = finished, ended; 'halafu' = afterwards, and then...