Thanks for all your help and resources
It seems I’ve got my first simple JS plugin logic fully working, except for the above mentioned JS error about invalid descriptor missing and strange layers moving issue, which I still need to solve and - I believe - wait for Adobe to fix layer moving, because it just doesn’t behave like it should.