You could use a $-sign expansion: The Magic of Dollar Expansions like:
$(=chr39) & concat(distinct [Sub Department], chr(39) & ',' & chr(39)) & chr(39))
to catch the dimension-values. These technique maybe combined with Variables with Parameters could shortened your expression. But I'm not sure if you really need these valuelist-stuff or if it's not easier to create this as a normal field within the datamodel.
I think you should simply create a amall extra table in the script:
DEPARTMENT as ReportDepartment,
'All departments' as ReportDepartment,
Then use the new ReportDepartment as the second dimension. If you want instead to use a column Sub Department then create the ReportDep table based on that field. This will work a lot better than a synthetic dimension and a huge pick( ... ) expression.