This function seems like a big kludge.  What if, anytime a cell was executed, some global IPython variable was set indicating which cell was executing?  Then it would be easy for comm handlers and other code to get the current output area.

I'm running into these same problems with the matplotlib widget.  I imagine that pretty much any widget-like comm thing will run into this problem of finding the current output region.