Hi Ronny
as I know it is not possible to add lines in Delivery Notes. You can only change some values if the line is still open and there's no target document linked.
Generally what you can do inside SAP Business One can be done using DI api and vice-versa.
B1if uses DI api to manipulate database.
Regards,
Pierre