I think there are two ideas of "nothing" at work. The first is the idea that you should avoid hitting buttons unnecessarily, because as you mentioned it means committing to an action. The second idea is when, in a single given moment, you choose to do nothing (not even move) because it is the right decision in that specific instance.
I recently played a Diddy Kong on ladder, who at one had me close to the edge and was throwing out fairs over and over to wall me out and threaten me. Clearly he wanted me to react somehow, either foolishly challenge his fairs or back myself all the way towards the ledge, but in that instance I literally stood still and did nothing, which turned out to be the right choice, because Diddy then felt like he wasn't getting things done and had to start approaching, which I was able to capitalize on.
If you're already in your ideal range, then doing
absolutely nothing except for waiting to push a very specific button (not just leaving your hands off the controller and deciding on what to do) can be correct, but you have to have in mind what exactly you're going to react to and what you're going to react
with. You're not just going to sit there and think, "oh, I'll figure something out when he decides to come near me." Sharpening your reaction time via anticipation (a skill that separates top players from everyone else) requires honing in on a
few specific options and their counters. Just waiting for the sake of waiting is meaningless.
A good example of a situation where you might stand completely still is this: you've cornered Bayonetta at the ledge and you just happen to be at the exactly correct spacing for your f-smash to connect on her without her being able to d-tilt you back. You think that she might either roll or Witch Time, but you're not sure which, so you can wait in this situation and
react to her action, f-smashing if she Witch Times and d-smashing if she rolls. You do miss covering some options such as her jumping over you, but you can't always cover every option; the fact that you cover the most likely ones is your reward for having stage control and spacing correctly. Waiting to react/doing absolutely nothing is a strong option here.
The given example is just a special case of not committing unnecessarily; it occurs when you are winning the microspacing battle by so much that any additional movement would probably cause you to regress or mess up your spacing. In most situations, however, this won't be the case, and there will be
some action that you can take to improve your position, whether that action is preemptively shielding or crouching or walking.
In the Diddy Kong situation you described, if Diddy is f-airing like that repeatedly you can walk forward -> powershield a f-air and punish it, or just outspace it depending on your character. Diddy's f-air isn't unpunishable, especially if it's poorly spaced, and you can
force the spacing to be poor if all he's doing is repeatedly f-airing without moving. If he
is moving, then the microspacing battle is still raging, and you can definitely respond to his movement pattern with one of your own and improve your position/set up a counterpoke.
While you still pulled ahead in that particular game, I would argue that you overlooked the opportunity cost of doing nothing in this case. You missed a punishment opportunity. I wouldn't call your decision incorrect, but calling it the right choice seems wrong too.
I'm also assuming that you had the percent lead if he was forced to approach you, because if you didn't, he had no reason to go in, and the correct response to your waiting game was for him to wait patiently as well.