Why is o-nitroaniline not more basic than aniline? We know from SIR effect (Steric Inhibition of Resonance) that in o-nitroaniline, the nitrogen's p-orbitals will change their plane, causing the conjugation/resonance of its lone pairs to stop. So, the only effect acting on it now is −I effect from the $\ce{NO2}$ group.

Comparing with just aniline, the $\ce{NH2}$ lone pairs are in constant resonance with the benzene ring making them unavailable for donation. Thus, aniline should be less basic than o-nitroaniline. But it isn't as per experimental values. So what's going on? What's the logic behind this?
Yes it is true that SIR is observed in o-nitro aniline so it will not show -M effect.

But I think you're confused in the resonance of the lone pair of NH2 group with the benzene ring which in fact occurs in both cases. The thing that makes o-nitro aniline less basic is the -I effect which makes the lone pair on - NH2 group less available for donation .

In fact the complete order of basic strength of nitro substituted anilines is:
[Aniline>m-nitro aniline>p-nitro aniline>o-nitro aniline ]