Ruby, 5656 52 bytes
-2 bytes thanks to Jo King!
-2 bytes thanks to dingledooper!
->n{d=[];v=0;nv,*d=0;n.times{|i|d<<v+=v<i||(d|i|d<<v+=v<i||d!=d-[v-i]!=d)?i:-i};d}
Commented:
->n{ ... } # lambda function taking an integer
d=[];v=0v,*d=0 # initialize list of sequence values d and previous value v
n.times{|i| ... } # run the following code for i = 0,1,...,n-1:
v<i||(dv<i||d!=d-[v-i]!=d)?i:-i # i IF (v < i OR v-id in!= (d without v-i)) ELSE -i
v+= # add this to v
d<< # and append the new value of v to d
d # return d