It is no problem to change the frequent flyer number before the flight. Ask your travel agent to do it and then double-check the number when checking in for your flight at the airport.
Regarding your previous flight, I don't know how many miles we are talking about. If you are willing to invest a couple of hours to get the miles to the DL account, maybe it's worth a try. I once asked LH to delete some miles from my account. They were very reluctant, but agreed to it as a one-time exception. In the end, it's a matter of discretion by the person who reads your letter in the end. From the perspective of a frequent flyer program, deleting miles is an administrative nuissance.