The Only Problem I Can See Right Now Is That Your Doing:
set %checkbid = whatever
when you use:
/set %whatever this data
there is no = in it.... i see that in a few places, maybe try fixing that and see from there.....
You Only User = for that when you use a local variable:
var %checkbid = whatever...