Have you tried Cursor? It’s the process you describe, minus the manual work of copy/pasting.
You can just select a block of code, and tell it to (e.g.) “make this function work as a decorator with graceful exception handling” and it will modify your selected code and provide you with a nice diff to apply in one keypress.
Or you can chat with the LLM directly in VS Code, with every snippet easily applied with a click. It can even catalog your codebase in a vector DB for really easy RAG:
“Create a view that allows premium users to view their billing history”
“Okay, I’ve found a function called get_premium_status in auth/user_profile.py. I’ll use that to create api/user/billing_history.py”
(Which then shows the code it will add or change, separated by file, with the option to apply the change)