Hi Dimster,
I've made a whole bunch of libraries. When- and whereever possible I did follow the rules discussed in the "Library Section" topic. The conclusion of it is here
https://www.qb64.org/forum/index.php?topic=495.msg4039#msg4039, also follow the notes given right after that post by Fellippe regarding the use of _OPTION EXPLICIT.
As an additional rule to it, which I've impossed on my own library code is the use of descriptive and prefixed label names especially for those labels which mark DATA lines for the use with RESTORE.
As DATA labels are in the global scope (even if defined inside a SUB/FUNCTION), they do interfere with all other DATA labels used in the users main module and even with global GOTO/GOSUB jump labels. So always use something like "MyLib_MyWhateverData" or "MyFunc_MyWhateverData" instead of just using common labels like "TheData".
If you need examples on how to apply the mentioned rules, then feel free and just inspect some of my libraries.