As long as a fligth has not been credited somewhere else, you should be able to retroclaim it to any program you have an account with, that would give miles for the specific ticket. So in your case, I'd personally just leave the UA number and retrocredit to KE after the flights.
You could also ask them to add your KE number in CPH at the lounge or at the gate, but then just make sure your SQ boardingpasses wil have the UA number printed when flying back.