Try this. Mostly the same as the answer given by Christopher_G_Lewis, but relies on a parse of the list output instead of errorcode, which I don't get either.
Also makes use of the cmd.exe shell construct A || B (if A fails then do B)
@ECHO OFF
REM --------------------------------------------------------------------------------
REM Check for and create VDir under Default Web Site
REM
REM %1 is the VDIR to create
REM %2 is the Physical path to the VDIR
REM --------------------------------------------------------------------------------
IF "%1"=="" GOTO Syntax
IF "%2"=="" GOTO Syntax
AppCmd.exe list vdir "Default Web Site/%1/" | findstr /I "Default Web Site/%1/" || AppCmd.exe add vdir /app.name:"Default Web Site/" /path:/%1 /physicalPath:%2
goto :eof