Haskell, 212212 207 bytes
This is probably way too long, but it finally works now. (Thanks to @Lynn for the cartesian product trick!) Thansk @nimi for -5 bytes!
import Data.List
b%l=[l++[x|b/=last l,x`notElem`l,1==sum[1|(u,v)<-x`zip`last l,u/=v]]|x<-mapM id[[1>0,1<0]|_<-b]]id$[0>1..]<$b]
b!a|f<-nub.concat.((b%)<$>)=snd$maximum$map(length>>=(,))$filter((==b).last)$until(f>>=(==))f[[a]]
b%l -- helper function:
-- given a path l (that should end in b) this generates all possible extensions
-- of l (if not possible also l itself)
x<-mapM id[[1>0,1<0]|_<-b]id$[0>1..]<$b -- generate all possible vertices of the hypercube
-- and check the criteria
b/=last l,x`notElem`l,1==sum[1|(u,v)<-x`zip`last l,u/=v]
-- extend if possible
[l++[x| ... ]| ... ]
b!a| -- actual function:
-- first define a helper function:
f<-nub.concat.((b%)<$>)
-- begin with the vertex a and apply the function from above repeatedly
-- until you cannot make the path any longer without violating the
-- criteria
until(f>>=(==))f[[a]]
-- only take the paths that actually end in b
filter((==b).last)$
-- and find the one with the maximum length
=snd$maximum$map(length>>=(,))$