Please note that if you're going to do that you should "anchor" the directory to be created in a sensible location like /tmp or /var/tmp (not "/" or other top level directories), ensure the variable isn't messed with or empty, in short: watch your error handling. Also if these are temporary directories consider using mktemp instead.
Code:
# Empty variable or way too short user name:
[ ${#USER} -eq 0 -o ${#USER} -lt 2 ] || exit 1
# Local user exists:
getent passwd "${USER}" >/dev/null 2>&1 || exit 1
# Obviously it's better to break off ops but here's one way to populate a variable
# and make errors stand out creating a dot-directory with epoch as time stamp and
# break off if directory creation fails:
ERRORVALUE=".mkdir_error_$(/bin/date +'%s')"
mkdir /var/tmp/${USER:=$ERRORVALUE}/ || exit 1