Procedural objects and arbitrary polygon objects are two very different things.
The settings in the cube do not add edge loops, they set the parameters under which the whole object is created. "Segments Y = 2" for example would mean (simplified): On the whole height of the cube, generate three points for every vertical, at Y positions -height/2.0, 0.0, and +height/2.0.
This is not difficult if you know the rules by which the parametric object is constructed.
Adding arbitrary loops to a poly object of which you don't know the theoretical structure requires a ton more work. First, you can't guarantee that the object only has quads and no poles, so your algorithm needs to consider these cases. Then, there may be ambivalences in what polygons your additional edge loop shall branch to (see loop cut issues). Then, what should the slider even do? Do you want to slice the object in one direction in regular intervals? That would require a complete retopology of the object.
Unless you are a excellent programmer and have a very good understanding of 3D and know exactly what you want to achieve, you are probably wasting your time.