My recommendation would be to create a ShiftCode table that stores the shift code and has a Min and Max column containing the shift start/stop.
I'd create a table because you are effectively managing a table in your function itself which, to me, is better suited as a lookup table. If the value changes you've got to update/exec function alter scripts where my preference would be to just manage the shift data in a table.
So something like the following would work
DECLARE @ShiftCodes TABLE (
ShiftStart time,
ShiftEnd time,
ShiftCode int
);
INSERT INTO @ShiftCodes (ShiftStart, ShiftEnd, ShiftCode) VALUES ('22:00:00', '5:00:00', 83)
INSERT INTO @ShiftCodes (ShiftStart, ShiftEnd, ShiftCode) VALUES ('17:00:00', '0:00:00', 84)
INSERT INTO @ShiftCodes (ShiftStart, ShiftEnd, ShiftCode) VALUES ('8:00:00', '18:30:00', 85)
This way you convert your 70 or so case statements to 1 select statement. Would need to account for possibility that your table doesn't have complete data so account for if no records returned...etc.
DECLARE @UsersShiftCode int = (SELECT ShiftCode FROM @ShiftCodes WHERE '21:01:01' <= ShiftStart AND '21:01:01' >= ShiftEnd)