Almost certainly not a factor in case statement/null logic, but...
varchar Column lengths are suspicious -- all varchar(50) in OptionsetMetadata & varchar(255) in account. Are those really the column lengths used? Why? They seem questionable/problematic if data in varchar(255) columns ever exceed 50 characters allowed in the other table.
Why are you taking columns that are varchar(50) in one table and varchar(255) in the other & casting them to varchar(100)? In order to compare at all, they'd better never be longer than 50 characters.
CREATE TABLE OptionsetMetadata (
...
ts_primarysecondaryfocus varchar(50),
...
ts_ukrow varchar(50),
CREATE TABLE account (
...
ts_primarysecondaryfocus varchar(255),
...
ts_ukrow varchar(255),