When I do something similar is I create a file with the asp code in it and nothing else.
Then I use it as an include file
However, if you only want to block certain content then you do NOT want to do the redirect because then you are blocking the entire page. So instead of having the redirect you can create a boolean value that is checked
Code:
Dim sBlockedIP
Dim boolBlocked
sBlockedIP = Request.ServerVariables("REMOTE_ADDR")
'check if the IP is the one that is blocked
If sBlockedIP = "00.000.00.00" Then
boolBlocked = True
End If
Next you will have in the page the part to block
Code:
<%If Not boolBlocked Then%>
some html to display
<%End If%>