At some point I implemented the logic for this, but the real obstacle is jline. It has enough trouble figuring out where the cursor is under the simplest conditions. Start throwing big multiline blocks into the history and it breaks down in tears. Would love to see this and #2547 addressed by the community.
At the time this ticket was created Paul hadn't yet added the :paste feature to the REPL. Now that it exists this ticket is even more relevant.
Stuff pasted into the REPL via :paste probably shouldn't become part of the history when you up-arrow through it. I'm typically pasting 5 or 10 or 20 or 50 lines of code, and it's annoying to have to up-arrow through all that stuff to get to the last expression I actually typed myself with my fingers.
I can imagine this might not be totally trivial to implement since :paste'd code should certainly be considered part of the history for :replay purposes, just not for up-arrow-ing purposes.
I'm adding this as a comment on this ticket, but it isn't strictly the same issue. If fixing JLine not to choke on multiline stuff is too hard, then it would still be very nice to have the "don't up-arrow into pastes" change just by itself.