Horseshoe-type diffeomorphisms with homoclinic tangency at the boundary of hyperbolicity