I would personally replace 'cost of building' with 'cost of maintaining', but otherwise agree with your reasoning. It's worth building in a factor of safety, such that I would formulate this idea as:
Only build software if the cost of maintaining it is 1/3 or less than the cost of buying a license.
(this has the nice second-order effect of being more robust to errors in the maintenance estimate, hence making it quicker to estimate).
Only build software if the cost of maintaining it is 1/3 or less than the cost of buying a license.
(this has the nice second-order effect of being more robust to errors in the maintenance estimate, hence making it quicker to estimate).