This line is not correct
(= (vl-position (strcase (vla-get-EffectiveName Obj)) '("DETAIL BDR" "DTLTITLE" "DET-TITLE")))
It should be (like we posted before)
(vl-position (strcase (vla-get-EffectiveName Obj)) '("DETAIL BDR" "DTLTITLE" "DET-TITLE"))
'vl-position' searches a list for the item supplied, so here it is searching the list you supply for the the name of the block you supply. If it finds it, then it returns the postion, if it doesn't find it it returns nil.