The bonus game luck seems to be dependent on something really complicated and unreliable. If I make the 1-up sound effect play 100 frames before the bonus game starts, the outcome doesn't change. But when I let it play 30 frames before, the outcome changes, and it changes again if I let it play 10 frames before.
During testing I found that the outcome changes if these addresses are written to: ff9f, ffbd, fffe and e0a4.
So since I can't understand the mechanics behind this, I'd stick to what I used to do when I made my SML TASes; simply play through a world, see if the luck is good, if it isn't, insert idle frames in the levels.
more RAM addresses:
FFA4 - map x-pos
C202 - mario x-pos
C201 - mario ypos
C203 - Mario's state
DFE8 - music ID handler
FFB3 - if changed, may lead to the end credits
FFFE - if written to, coins increase by 1. If Mario touches a coin, this address is written to.
C0A3 - If written to, lives count changes.
FF makes it decrease by 1
1~FE makes it increase by 1
EDIT:
Another points improvement:
In 1-1, chain the two flies near the end of the level to gain 400+800 instead of 400+400 points.
EDIT:
Probably I won't finish the regular mode improvement, because it's too laborious work for me.. There's VBA21 and VBA24m. The latter is more accurate but slower by an estimated 250 frames. Using the former is against the site's sense to be as close to the real console as possible. There's versions 1.0 and 1.1; the latter has better luck over the former on VBA21, hence why it was used.
Now I really don't feel like playing through all the worlds again, on VBA24m on both 1.0 and 1.1 to see which has better luck, and then inserting idle frames one by one to see if the luck changes to my benefit. And then coming up with a new run which is actually 250 frames slower...