Only reason for the FOR command not enumerating files in name order is that the file system is not NTFS. FAT filesystem enumerate files in drop order.
So use explicit name order enumeration
for /F "tokens=*" %%i in ('dir /b /on *.sql') do (
sqlcmd -S .\istance -U username -P password -d dbname -i %%i -o .\%%i.log
)