A question for you: Why do you want to replace it? Is the emulator actually better than the one included in Retropie? If so, you should let us know by filing a bug report and we’ll then replace it with the better emulator if it’s the case and we can get it working.
As for how to replace it yourself, it depends entirely upon where it comes from. If it’s in the Raspbian repositories, you could probably apt-get install it yourself. I’ll bet that uae4all will come back once you run a binary update. I guess you could uninstall it and then symlink uae4all2 to uae4all as well so that Retropie actually runs the second one instead. Hope they have compatible command lines or else that won’t work.