Passing the edit object to the end_edit() function did the trick - thanks!
BTW, I'm my command is a WindowCommand, so if I've understood correctly, I need to both begin the edit and get the active_view(). However, I'm not sure that making my command a WindowCommand is correct - after reading the API documentation I've had some problems understanding which command to use when.
It's also making use of the show_quick_panel() function of the window object. Doesn't that mean that it needs to be a WindowCommand? Or where would I otherwise locate the window to call the show_quick_panel() function on?