I don't know if the battery/chip is write protected or not. If it is enabled so that it can be written to, then you should be able to connect to the chip and write to it.
is there the risk of locking/damaging the battery/chip?
If you don't have the registers correct, and you write to a wrong location you could possibly mess something up.
EDIT: Since you have marked this code as a solution, then I guess you didn't brick the chip ![]()
do I have to put the whole code in a sketch?
You can certainly add the wrtiteWord() function to the code you provided and only call it if you want to reset the cycle count.
You may be able to create a more simple sketch to just write, but I'm not clear about how exactly to do that. The sketch you provided uses the SoftI2CMaster.h library to communicate with the chip. I'm not at all clear about why the sketch author went that route instead of using the Arduino wire library.
I'm not at all familiar with your battery or its chip. I used this reference for the SMBUS and I think it should be compatible with the Arduino wire library.
https://www.nxp.com/docs/en/application-note/AN4471.pdf