When writing addons for Blender 2.5x, it is recommended to follow the convention “select object, perform action, then adjust settings”. That is, instead of entering settings for the operator before invoking it (and trying to guess what the effect is going to be, guessing wrong, and having to undo and try again), you can play around with them after invoking the operator, and get immediate feedback on the right settings to achieve the effect you want.
I have added a page to the 2.5x scripting section in the “Blender 3D: Noob to Pro” Wikibook explaining how to implement this here
By the way, the included scripts in the Blender source tree (at least as of revision 33956, the last one I checked out from a couple of days ago) implement this in a much more convoluted way, involving replacing the data of a previously-created object according to the setting of a magic hidden “edit” property. This is all completely unnecessary now, and in fact that “edit” property no longer works.