Inspired by @daniel-l-vandenbosch, I'd prefer this one, without overloading ;-)
CREATE OR REPLACE FUNCTION iif(condition boolean, true_result anyelement, false_result anyelement)
RETURNS anyelement
LANGUAGE SQL
IMMUTABLE PARALLEL SAFE AS
'SELECT CASE WHEN condition THEN true_result ELSE false_result END';
This is using ANYELEMENT instead of TEXT, so it should work with more datatypes without casting/conversion.
Also added immutable and parallel safe to improve performace.