John Swinney has tried to revive hopes for a green jobs boom in Scotland although UK government spending cuts could pose big challenges.