You could change URL for that script with a command:
<tr>
<td>runScript</td>
<td>document.querySelector('script[src="http://cnd.foo.bar/lib.js"]').setAttribute('src', 'http://localhost:3000/lib.js')</td>
<td></td>
</tr>
But when you execute your Selenium script browser is allready downloaded CDN javascript and nothing will happen.
You could delete reference to CDN js add reference to local javascript to your DOM :
<tr>
<td>runScript</td>
<td>var sc = document.querySelector('script[src="http://cnd.foo.bar/lib.js"]');sc.parentNode.removeChild(sc);</td>
<td></td>
</tr>
<tr>
<td>runScript</td>
<td>var js = document.createElement('script'); js.src = 'http://localhost:3000/lib.js'; document.head.appendChild(js);</td>
<td></td>
</tr>
That will load new javascript. But maybe some scripts from CDN will be executed on page load.
IMO best solution is run localhost on port 80 and then set CDN url to 127.0.0.1 in hosts file.