I really can't answer for code....
... but ....
in my field, design, I'd find this comparable to illustrations. I customarily charge a multiplier for exclusive rights to illustrations. Somewhere around 3x or 4x works out well.
What I generally do is estimate the time needed to create the original... then apply the multiplier. This generally covers many future usage scenarios since that creation time would be needed at least once if I were to come across the need for something similar and not be able to use what I've already created or have on-hand.
This somewhat depends on rights as well and not merely exclusivity. If the client wants all right then a higher multiplier is warranted. If the client merely wants an exclusive license, then I negotiate a time frame for exclusivity. After all, if the client doesn't want the rights, but wants exclusivity - what benefit is there in me not transferring rights unless the exclusivity ends at some future point?
I always include the cost of exclusivity as a separate line item on quotes so that the customer can see what that specific factor is costing them.
So either:
Exclusive License For XX years/months/etc ... $xxxx.xx
or
Transfer of Copyrights ... $xxxx.xx
Some clients quickly change their mind about exclusivity when they see figures. On the other hand, like all quotes, some clients don't have a problem with the figures at all.
In truth, it's very difficult to quantify values, at least for me. There's no telling exactly how much I'm giving up in terms of future usage. So really, it's all just "best guess" and figures are high enough where I won't feel I shorted myself when looking back on things.