> Now, the function works smoothly...unless a "lever" series already
> exists in the dataset. In that case the following error message is
> generated,
I don't see this problem here. You might have to send us a
self-contained example, preferably with one of gretl's shipped datasets.
What version is this?