Conditional DATEDIFF

I have a query that returns the number of business days between two dates for a ticketing system.  I'm trying to determine average resolution times for our support tickets and have a beast mode that works for the total number of business days between case open and case resolved.

 

CASE DATEDIFF(`Resolved Date`, `Case Creation Date`)
WHEN 0 THEN
ROUND((HOUR(`Resolved Date`) + (MINUTE(`Resolved Date`)/60)) - (HOUR(`Case Creation Date`) + (MINUTE(`Case Creation Date`) / 60)))
ELSE
ROUND(
(17 - (HOUR(`Case Creation Date`) + (MINUTE(`Case Creation Date`)/60)))
+
(
5 * FLOOR(DATEDIFF(`Resolved Date`, `Case Creation Date`) / 7)
+
CASE SUBSTRING('0012345400123433001232230012112300100123000012340', 7 * (WEEKDAY(`Case Creation Date`) - 1) + WEEKDAY(`Resolved Date`), 1)
WHEN '0' THEN 0
WHEN '1' THEN 1
WHEN '2' THEN 2
WHEN '3' THEN 3
WHEN '4' THEN 4
WHEN '5' THEN 5
END
) * 8
+
((HOUR(`Resolved Date`) + (MINUTE(`Resolved Date`)/60)) - 9)
)
END/8

 

Now, rather than the total number of business days for all tickets, I'm wanting to filter in the beastmode by a case label to get average times when tickets are escalated to our T2 support or our T3 support.

 

IE  

WHEN `Case Labels` LIKE '%T3%' THEN DATEDIFF...

 

Is it possible to nest this condition before I run all my DATEDIFF logic?  Something like: 

 

CASE
WHEN `Case Labels` LIKE '%T3%' THEN 

DATEDIFF(`Resolved Date`, `Case Creation Date`)
WHEN 0 THEN
ROUND((HOUR(`Resolved Date`) + (MINUTE(`Resolved Date`)/60)) - (HOUR(`Case Creation Date`) + (MINUTE(`Case Creation Date`) / 60)))
ELSE
ROUND(
(17 - (HOUR(`Case Creation Date`) + (MINUTE(`Case Creation Date`)/60)))
+
(
5 * FLOOR(DATEDIFF(`Resolved Date`, `Case Creation Date`) / 7)
+
CASE SUBSTRING('0012345400123433001232230012112300100123000012340', 7 * (WEEKDAY(`Case Creation Date`) - 1) + WEEKDAY(`Resolved Date`), 1)
WHEN '0' THEN 0
WHEN '1' THEN 1
WHEN '2' THEN 2
WHEN '3' THEN 3
WHEN '4' THEN 4
WHEN '5' THEN 5
END
) * 8
+
((HOUR(`Resolved Date`) + (MINUTE(`Resolved Date`)/60)) - 9)
)
END/8

 

Can anyone help as to how I would format this?

 

Thanks.