Yes, that would be great, a function that knows which one to delete.
The polygons inside the mesh are not double polygons; they are somewhere, and finding which one to keep is not easy for an algorithm.
So, the first test for me is typically the Modeling Check; do it on a copy while hiding the original. It lets you see what the whole thing is about and lets you select the parts that will not work.
If you delete them, you might delete too much, but if you do it with a copy, it helps to understand the problem.
Next is a simple one: place the object under a Subdivision Surface. It shows often where things went wrong.
With that knowledge, some polygons can be picked out pulled on to see if they are connected, etc. CMD-Z brings it back, then uses the selected and Selection> Hide Selected. With this, more can be seen inside of the object.
Now comes the hard part: repair or start over.
The answer was easy in this case: start over, but use a few polygons to be fast with it.
The front frame selected (visible only), Invert [U~I], then delete all others.
The remainder selected and Extrude with Create Caps on.
The offset can be measured from the original part.
Now: Create Caps OFF! This is often forgotten and creates models like the problem model we discuss. So, always OFF after an operation.
Then offset some of the other parts (Symmetry selection can help here)
The lower part of the frame has a titled area, which can be easily moved with the related points. Extrude the small side as in the original. Done.
Check with SDS to see how that should have looked to gain an idea for future tasks.
All the best