Problems:
1) You can't reassign the F1 key. Any other F key, either by itself or with either shift or ctrl, yes, but not F1.

2) The last two braces in your code are backwards. You have open braces being used in all locations, but for the script to work, you need a closing brace for each open brace

Code:
F2 {
  if <bots_nick> isop #channel {
    .msg $v1 subop $v2 <password>
  }
  else {
    echo -a *** Error $v1 is not OP on $v2
  }
}