With Editable Stored Actions, you can do this:
Before doing something with an undistinguished thing:
let the new action be the current action;
if the noun is undistinguished:
change the noun part of the new action to the holder of the noun;
if the second noun is undistinguished:
change the second noun part of the new action to the holder of the second noun;
try the new action instead.
The reason the previous code needs to use “component parts core” is because this rule will only run once per action; once the action has been changed, the Before stage it already past and won’t run again. This code will launch the new action as its own separate thing, so it’ll go through the Before stage again, and potentially go up another level of indirection in the process.