I removed the “OutlineIndent” statement from the code and now it works perfectly, luckily it did not trigger another ProjectBeforeTaskChange2 event.
However, I would be more than grateful if you could post the links to the documents you mentioned. Anything that can help me get more insight into these topics is more than welcome!