I was wondering if all game code fits on 16KB for example, my framework already takes ~4.5KB
How big are your programs?
How big are commercial NES programs?
This definitely depends from a game, its complexity, and quality of the code. It is difficult to measure the size of the code in my own projects, as it often interleaved with all kinds of data. Anyway, so far all my games were NROM, one of them 24K even, other was 40K but with compiled C code, and had some empty room. So I think I can say that it never was more than 16KB of code for me.
I think that large, complex games could easily have more than 16K of code.
Some games certainly have all of their primary/main thread code under 16K. But they will probably put the music engine in a swappable bank, as well as most of the data. The majority of your PRG-ROM will be data anyway. Not unless you have crazy bloated code or something strange.
I've not even sure what you mean by your framework. You shouldn't worry really unless you can't fit into your chosen hardware. Since UNROM/MMC1 where you have a 16k/16k fixed setup is common, you'd want to be sure if using those to keep your main code under that much. Plenty of commercial games do exactly this.
SMB1 has (comparatively) a lot of code and not a lot of map data because it's crazy compressed, unless you count the CHR ROM as data too.
I expect my game to have more than 16KB of code. For this reason I have tried to put most of the code that doesn't need access to other banks in a switchable bank. That way the hardwired bank can be mostly dedicated to the main engine, which does access data all over the ROM. Music code and data are in a separate bank as well.
Although I hope that the main engine will fit in the 16KB of the hardwired bank, I'm prepared to move parts of it to a switchable bank (such as the AI for objects that don't need to collide with the background).
My game used 3.95 KB for the main character's routine alone. This included movement and jumping, slope detection, updating and scaling velocity, detecting collision points, multiple direction shooting etc.
I'm currently rewriting it, but I bet it will end up even larger once I add object-object collision detection and the grabbing and throwing of objects.
If your NMI/code makes your game scroll/update attributes is 4.5 kb, I don't think that's that bad.