Uops,
not in front of a computer right now but perhaps you need to stop or to wait the ADV procedure to finish, change the ADV data, apply the function and start again?
Try this, it will take less than 10 seconds and if not tomorrow I can further help you when I'm in front of my CC2540DK :)
I did a very similar test with the keyfob some time ago and it was easy to perform such ADV variable procedure.
Bye!