When calling tryDown(), it will call tryDigDown().
Unfortunately, tryDigDown() does not exist. Here's what I think you meant to add for tryDigDown():

local function tryDigDown()
 while turtle.detectDown() do
  if turtle.digDown() then
   collect()
   sleep(0.5)
  else
   return false
  end
 end
 return true
end