Update the fail redirect to add a url parameter so you can tell if it is failing the login or if it is trying to go to the admin but failing validation on the admin.php page. So update this line:
$FailedRedirect = "index.php";
$FailedRedirect = "index.php?fail=1";
Then try to log in and see what the url is after you attempt to log in. If it has ?fail=1 at the end, then that means it is failing login. If not, then it may be an issue with admin.php page or the trigger for login not firing.