I think most professional advice (I am not a professional programmer, but I am channelling advice I have listened to) would be to compartmentalise everything you can. Break your code into tight classes and utility libraries, and test them thoroughly. Push tested libraries into separate tabs or even projects (and reference them into the main project). Also keep everything “loosely coupled”, so your game is as flexible as possible.
All this helps control the growing pains of large projects, including code sprawl, nightmare debugging (especially given Lua’s extremely limited debugging tools), and code refactoring forced by finding you’ve painted yourself into corners.
Codea saves as you go, which is usually good, but if you make some changes and break something, you will be wishing you’d kept the previous code. So I would save backups often.
One nice feature of Codea is that you can have two copies of a function and when Codea compiles, from left to rght, it will overwrite the first with the second, so only the second one gets used. So if you want to make some changes to tab X that might break it, you can do things like making a complete copy of that tab’s code to its right (or maybe just the functions you are changing) and then modifying it and testing it. It will be used instead of the original code, which is still there if you need it.
I wrote a 2D widescroller demo recently, and although it is way smaller than what you are talking about, I found the best design (for me, anyway) - after starting over about four times - was to build a set of images, a set of interactive object classes with behaviour, and a level editor that reads in a simple ASCII map and creates the level from that, using the images and objects. This allows me to create new levels in an hour or so, adding new maps, object classes or images freely. None of these things depend on each other.
So in your case, I would probably write the game framework to handle the UI menu, scoring, etc and room transition, plus anything that doesn’t change between rooms, then start writing room behaviour as separate object classes, as you suggest, but I would pull duplicated code out into utility classes (eg perhaps player movement) as you go.