Note that the simplest way to add single quotes is to use the %BQUOTE() macro function as that will allow single quotes in its input and yet still evaluate the macro triggers.
Use %QSCAN() incase the string pulled from SYSPARM as macro triggers itself.
Once you have the single quotes around the value you can safely remove the macro quoting.
%let var1=%unquote(%bquote('%qscan(&sysparm,1,%str( ))'));
If it is possible the "value" has single quotes in it that you will probably want to use the QUOTE() function wth the optional second argument of a single quote instead so that any embedded single quotes are properly handled.
%let var1=%sysfunc(quote(%qscan(&sysparm,1,%str( )),%str(%')));
... View more