I guess there are good reasons you're not using the pipe network tools in Civil 3D, because you could just define a label style for a structure and be done with it.
Here's some simple code for editing attributes inside dynamic blocks. You may have to call the routine three times in a container function, once for each type of variable. For the inverts, I would begin by setting to zero, getting the value, and resetting the variable only if it exists.
And as always, Lee Mac did it first: here are some helpful dynamic block functions.
My diesel-fu is rusty, does your code do anything besides handle the window and get user input? What are you trying to do that's not possible in the usual attribute editor, besides validating the input?