I would always strive for clean copy (grammar, finding typos, etc.) and the very best ms. you can write by your own (and some trusted betas' or CPs') standards. But beyond that, try not to torture yourself about this.
I edit for a living. I catch typos, use commas consistently, know my usage rules, all that stuff. I can produce mss. that are incredibly clean and presentable on a sentence or paragraph level but unreadable on an overall story level. Pacing is the demon I struggle with.
Here's the thing: you would not believe how many stages of revision there are. A really good editor can push a book beyond anything you envisioned. If my goal were to write books so clean they didn't need any editing from anyone but me, I would invariably be horribly disappointed by the publishing process.
When an editor offers on your book, they tend to write a letter full of lovely compliments. What a wonderful book! Your head gets swollen. Then, weeks or months later, you get the editor's notes, and suddenly there's SO much wrong with this wonderful book. Why did they even buy it? you wonder. It's an incredibly humbling moment.
But you use the notes and keep revising. And the book gets better. And then a copyeditor comes and questions every single tiny thing that hasn't already been questioned. And then there's maybe another copyedit, and a page read, and more questions. And then someone writes a review tearing the book apart, and you're humbled yet again. And maybe years later you're reading your own printed book and still wishing you'd reworded this or that sentence.
All this scrutiny and second-guessing does have a purpose. I've read books from small, understaffed presses that were painfully under-edited. Basic errors, inconsistencies, poor pacing — not good things.
My advice would be to get input from trusted readers on issues like pacing, and to proofread carefully, but not to imagine that you can really know what's "polished" or "publication-ready." Prose can be polished, in a relative sense — easy and pleasant to read, etc. But readying a book for publication involves collaboration and the input of a team. All you can hope to do is make your book attractive enough for that team to want to get involved, then benefit from their wisdom.
This is another way of saying that the entire process is humbling, at least in my limited experience, but also incredibly rewarding. If I self-published, I probably wouldn't hire an editor, because I know I can copyedit my own work. Using CPs for rigorous developmental input, I think I could produce a reasonably "polished," easy-reading book. But I would miss the input of that professional publication team — really, really miss it. It takes things to a level I can't reach alone.
ETA: I think I wrote a ton and didn't really answer your questions. Let me try:
— No, it's not possible to self-edit to "publishable standard," unless you're just talking about clean copy. "Publishable standard" is the product of an interaction between an individual book, author, agent (probably), and editor. Sub in a different editor, and it changes.
— A book that gets acquired is a book that was polished and readable enough to make a team of people want to read it all the way to the end. As far as I can tell, that's the only constant. People enjoyed reading it. People believe others will enjoy reading it. A book can be enticing in that way and still have pacing problems in certain areas, or characterization that needs to be worked out, or a whole ending that has to be rewritten — according to that team, anyway. That doesn't mean you should give up on fixing such problems on your end, while you still can, just that you can't anticipate all the concerns that other people — even huge fans of the book! — will have.