just notice your brackets are still incorrect too . if you use multiple logical conditions in if statements they must be parenthesized
eg
If (maxbright * 100)/255 =0 or (maxbright * 100)/255 <10 then

should be

If ((maxbright * 100/255 =0 ) or ( (maxbright * 100/255 <10 ) then