Yeah, you'd have to tag the start of each line with a fixed identifier used as a hash, and then reference each hash to its source file so even if they get mixed up they're not altered. And if those hash references go away then those lines aren't updated.
13837390|int foo(int a, int b)
83928173|float food(float a, float b)
I think so long as the user is editing those lines under this purpose and appropriately, meaning just making single changes from one source line by line rather than multiple files, it would be of great use.