Kashmir isnt "another country." Kashmir is pretty much occupied territory, so ISI getting involved there is perfectly legal by your own definition..:)
Even if its occupied, its occupied by India. So ISI is still poking its nose in the affairs of India which is not "perfectly legal".