I've thought about it. The daunting bits are the trickiness around how long the session should live. You'd like the repl's variables to persist between commands, etc, but at the same time letting an arbitrary code session live for a long time on your server is probably not the safest thing. If you have any resources on the topic, I would love to look at them.
What about using JRuby on the server-side?