The double integral of the charge density across the membrane gives the dipole potential; I'm not quite sure if that's what you want or not. It is strongly dependent on the force field.

By default CHARMM assumes a time base, so the stated definition of INTEgrate is wrt. to time starting at zero. For a z profile, you have to change the independent variable to match the z values via EDIT; for a range of -40 to 40 in 0.1 A intervals, something like

edit chg delta 0.1 skip 1 offset -40.

would be needed.

Perhaps you should reconsider writing your own program for this.