First up in the first if-statement you use ===. I think it should be == since it will not really return true. That is probably the error that blocks all pages.
Usually when I work with booleans I set it to one value in the beginning and only change it if it should be changed. The reason is that it is easy to make a mistake otherwise, like you have done. Let's say that we input "othersite.com", the second blocked site and go through the code.
Function isblocked(othersite.com) is called
The loop is called, $i = 1
if-statement is false
$blocked = false
the loop is called, $i = 2
if-statement is true
$blocked = true
the loop is called, $i = 3
if-statement is false
$blocked = false
end of loop
false is returned, but you want true to be returned.
To avoid this problem set $blocked=false before the loop starts. Then only change it if $blocked should be true.
Edit: NogDog is correct, my first paragraph might be way off. But the rest still applies.