I compiled and ran this and found a typo in line 18 (npos) but no problem. I also had an error at the line 45 with the if(open).
Line number 45, Error Number: CS0029, 'Cannot implicitly convert type 'int' to 'bool''
I have found you can not have just if(open) you must use if(open == TRUE) which to us is the same thing but not to this compiler :)
I made that one change and fixed the typo npos and it works great as a sliding door. As far as your errors Im not sure but I think I have been using a return; at the end of my functions and that solves the return type errors.