You have to filter the count by the instance to find the correct number.
I think a discussion for 3 days that allows anyone to participate followed by 7 days of voting, only by local accounts, makes sense.
Even if I were away for a week, I'd be likely to see the discussion before or the vote after.
I would have the bot work like this:
Find the total subscribed agora users.
Find the number of agora subscribers from this instance.
Assume every user from the local instance votes nay, then start reading replies.
For each reply, if the local subscriber uses the "aye" tag, change their vote to aye and record the timestamp for that reply.
A later reply with the "nay" tag should be able to undo that user's previous approval.
The bot should report the counts each day and a final summary after the voting period has ended.
If it's not over 51%, then the vote should fail to pass.