Currently, I try to track script versions by manually updating the script description (not the script name as recommended here: https://wiki.secondlife.com/wiki/LSL_101/Creating_a_Script). Updating the script name or description is tedious and error prone (and changing the name of the object with llSetObjectName () adds other complications, not least having llListen() being able to target an object by name).
I have an automated script build pipeline that generates version numbers that I use for both scripts and objects contained in a single repository. It uses the C preprocessor to finagle a #define VERSION statement into the LSL that is then loaded into the object's description in the state_entry event in the default state.
However, this is far from perfect as the object description (or name) is associated with the object, not the script. Worse, there may be multiple scripts in an object that have different version numbers.
It would be nice if there was a script writable field associated with the script that you could write to from the script, similar to llSetObjectDesc (). Failing a specific field dedicated to a version number, let us write to the script's description field by adding a function llSetScriptDesc ().