Not OP, but I can definitely +1 this idea. It's a sorely missed component that must be thought through and implemented/specialized for literally every project (done in C/C++/etc anyway).
There are quite a lot of other complicated factors such as "what thread does this run on?" and "when?". When you are debugging and hit a breakpoint then you basically have a REPL in the Immediate window...