Howdy,
It looks as though your issue is the number of single quotes around CurDBSchemaVersion
Try:
When @import_type = 'UserDetails' Then
'exec master..xp_cmdshell ''bcp "Select v.EntryValue, FirstName, GroupID From VC..UserDetails LEFT JOIN VC..UserGroup ON...