I wish I were learning it was even that easy. Maybe it is, and I'm just thinking about it too hard.
To borrow your analogy of the can of worms module, that it runs well but will become a bomb as soon as someone decides to rewire it fills me with a sense of deep dread. My mind immediately drifts to the scenario where something forces changes on that module, such as the server continuously crashing due to a latent schrodinbug that just surfaced, but in a time-frame where those 47 issues just can't be resolved. I've never been comfortable with the justification that "it works now, so just don't screw with it." It seems to just be begging for Murphy to make a fool of the person justifying a decision thusly.
I used the analogy of technical debt being called in a post a few months ago to describe this situation. Granted, my experience as a developer is still somewhat limited, but I have seen people with years of experience get completely hosed by deciding wrong; sometimes deciding wrong a lot. I've also seen people with just a couple of years of experience pick the way to go with decent accuracy. This makes me wonder if there is an intuition certain people have that experience hones, but that experience alone does not completely replace.
Yes, so you make that part of the decision. It's all contextual; you can fiddle with this hypothetical this way to make it 'yes', you can fiddle with it the other way to make it 'no', and both hypotheticals will be simplified to the point of irrelevance compared to any real situation that may arise.
I've also experienced some weird premonitions, like I'll suggest a change be made, based on some trend I may be seeing but can't articulate, and then a few days later the very thing I suggest should be changed needs to be changed, usually under time pressure.
I wish I could bottle and sell this, but I'm sure it's closer to being unlucky than having a superpower (like Rob McKenna from HHGTTG), and no one would want it.
Adding experience to a person who is not smart or capable, stubborn, lazy, or has other personality "issues" is generally a waste of time and resources. Looks like you've met a few of these people. Most of us have.
Should we worry about how well a certain module was written? Maybe, maybe not. Sometimes the answer really is, "It runs well and isn't hurting anything, so let's leave it alone. Opening up that can of worms dumps 47 new issues into our queue and now is not a good time to do that." Or the answer may be, "This has to be made right before we can add these 27 other things to the system or we'll all be in deep sh*t." How do you know which? Experience. Understanding the big picture. Understanding your customers and users. Understanding your dev team. You get the idea.
Taking on a lead role is not selling out if it's used to expand your horizons and make you an all-around better dev person. When you return to full time development, you'll be light years ahead of those who never had to manage the whole project. A little perspective goes a long way.