First, do the scheme at a better time. Do it when England is pissed off at Spain and can encourage some privateers/pirates in the Caribbean to give Spanish shipping and such in the area hell.
Second, choose a better location than one of the most rugged and harsh environments in the Western Hemisphere outside of the Arctic which to this day is impassable by road. That's the main reason it failed. But the problem is, the best locations in Central America all had signficant Spanish presence. So you'd need to get rid of Spanish rule over Panama to have it succeed. I'm not sure the Darien scheme could succeed, it's all a matter of how big of a disaster it will be for Scotland.