An SNP majority at the Scottish election would “stop Nigel Farage at the border”, John Swinney has said..