Gecko.. Please don't take this the wrong way, but from looking at your script (and the fact that you've asked me to help you with it) I'm guessing that you're still learning VB Script. I think the best way of learning is by doing, so rather than rewrite your script, I'll try to help you along the way as follows...
The InStr function is just like the InStrRev function, except that it starts looking for the for the substring from the beginning of the source string, rather than from the end, so...
...returns the value 2
TwoPos = InStr("12345678987654321", "2")
...returns the value 14
TwoPos = InStrRev("12345678987654321", "2")
Here's the function to determine if a computer is in an OU. You can just add the function to the end of your existing script.
Usage: IsComputerInOU(<OU Name>)
dim oAdSysInfo, sComputerDN
set oAdSysInfo = CreateObject("AdSystemInfo")
sComputerDN = oAdSysInfo.ComputerName
IsComputerInOu = (InStr(1, sComputerDN, "OU=" & sOU, vbTextCompare) > 0)
Returns: True if computer account is in or below an OU with the name 'OU Name'
The function works because of what is returned by the AdSystemInfo.ComputerName method. This returns not just the Computer Name, but the Distinguished Name (DN) (see RFC 1779) of the computer account object. If you imagine that your computer is call IT1-01, that it is in an OU called IT1, which in turn is in an OU called Computers, which is in the domain School.Local, then the Distinguished Name (DN) of the computer account object would be
If IsComputerInOu("IT1") Then
It's then a simple matter to use InStr to see if, for instance the string 'ou=IT1' exists in the full DN string. If it does, then computer account is in (or below) the IT1 OU.