Fascinating question!
Here's how I'd approach calculating those dates (based on info in this answer on StackOverflow):
%%[/* Modify to view AMPScript <div style="display:none"> */
/* adapted from: https://stackoverflow.com/a/5422046/812377 */
set @today = now(1)
set @today = "2017-10-15"
set @monthOfThisMonth = DatePart(@today, "M")
set @yearOfThisMonth = DatePart(@today, "Y")
set @firstDayOfMonth = dateparse(concat(@monthOfThisMonth,"/01/",@yearOfThisMonth))
output(concat("<br>today: ",@today))
output(concat("<br>firstDayOfMonth: ",@firstDayOfMonth))
set @dayOfWeek = Format(@today,"ddd")
output(concat("<br>dayOfWeek: ",@dayOfWeek))
var @dayOfWeekNum
if @dayOfWeek == "Sun" then set @dayOfWeekNum = 1
elseif @dayOfWeek == "Mon" then set @dayOfWeekNum = 2
elseif @dayOfWeek == "Tue" then set @dayOfWeekNum = 3
elseif @dayOfWeek == "Wed" then set @dayOfWeekNum = 4
elseif @dayOfWeek == "Thu" then set @dayOfWeekNum = 5
elseif @dayOfWeek == "Fri" then set @dayOfWeekNum = 6
else set @dayOfWeekNum = 7
endif
output(concat("<br>dayOfWeekNum: ",@dayOfWeekNum))
set @dayOfWeekFriday = "Fri"
output(concat("<br>dayOfWeekFriday: ",@dayOfWeekFriday))
set @dayOfWeekNumFriday = 6
output(concat("<br>dayOfWeekNumFriday: ",@dayOfWeekNumFriday))
set @offset0 = subtract(@dayOfWeekNumFriday, @dayOfWeekNum)
output(concat("<br>offset0: ",@offset0))
set @offset1 = iif(@offset0 < 0, add(@offset0,7), @offset0)
output(concat("<br>offset1: ",@offset1))
set @dayOfWeekFirstDayOfMonth = Format(@firstDayOfMonth,"ddd")
output(concat("<br>dayOfWeekFirstDayOfMonth: ",@dayOfWeekFirstDayOfMonth))
if @dayOfWeekFirstDayOfMonth == @dayOfWeekFriday then
set @offset = 0
else
set @offset = @offset1
endif
output(concat("<br>offset: ",@offset))
set @firstFridayOfTheMonth = dateadd(@firstDayOfMonth,@offset,"D")
output(concat("<br>firstFridayOfTheMonth: ",@firstFridayOfTheMonth))
set @secondFridayOfTheMonth = dateadd(@firstDayOfMonth,add(@offset,7),"D")
output(concat("<br>secondFridayOfTheMonth: ",@secondFridayOfTheMonth))
set @thirdFridayOfTheMonth = dateadd(@firstDayOfMonth,add(@offset,14),"D")
output(concat("<br>thirdFridayOfTheMonth: ",@thirdFridayOfTheMonth))
set @fourthFridayOfTheMonth = dateadd(@firstDayOfMonth,add(@offset,21),"D")
if DatePart(@today, "M") == DatePart(@fourthFridayOfTheMonth, "M") then
output(concat("<br>fourthFridayOfTheMonth: ",@fourthFridayOfTheMonth))
else
output(concat("<br>fourthFridayOfTheMonth: n/a"))
endif
set @fifthFridayOfTheMonth = dateadd(@firstDayOfMonth,add(@offset,28),"D")
if @monthOfThisMonth == DatePart(@fifthFridayOfTheMonth, "M") then
output(concat("<br>fifthFridayOfTheMonth: ",@fifthFridayOfTheMonth))
else
output(concat("<br>fifthFridayOfTheMonth: n/a"))
endif
/*</div>*/
]%%
Output
today: 2017-10-15
firstDayOfMonth: 10/1/2017 12:00:00 AM
dayOfWeek: Sun
dayOfWeekNum: 1
dayOfWeekFriday: Fri
dayOfWeekNumFriday: 6
offset0: 5
offset1: 5
dayOfWeekFirstDayOfMonth: Sun
offset: 5
firstFridayOfTheMonth: 10/6/2017 12:00:00 AM
secondFridayOfTheMonth: 10/13/2017 12:00:00 AM
thirdFridayOfTheMonth: 10/20/2017 12:00:00 AM
fourthFridayOfTheMonth: 10/27/2017 12:00:00 AM
fifthFridayOfTheMonth: n/a