I only program on Mac OS X...
The arcade version has actually 5 different colors of bottles. I don't know if it's just a cosmetic change or maybe it generates different kinds of bonus items to pick up. In the NES version, both blue and green bottles seem to have exactly the same effect. What you pick up is determined by the level group you are in. A level group being 16 levels. You either get cookies, 4-leafed clovers, flowers or bags of money. The Bonus game is always the same setup: you have 30 seconds to pick up as many items as possible. Each item gives 500 pts, and you get a bonus of 100,000 pts if you manage to get them all within the time allowed...
Since I analyzed how Special Items appear in the level, I made a Data section in my editor, where you can choose which item appears and conditions threshold. There are 15 counters that keep track of different actions and when one of these counters reach a certain threshold, the corresponding item will appear at the start of the next level, and the counter is reset to 0. If more than one counter are triggered during a level, the lowest in the list will take precedence. However, only the counter that effectively sets an item to appear will reset.
Another delicious screenshot:

What you see is a direct translation of how the game code operates. A Green or Blue Candy will be replaced by a Red Candy on a random basis (1/16, or 6.25%). The Shoe and the Bomb and the 3 kind of Crosses have no alternate. The Heart has its own apparition condition (without alternate), but can also appear randomly in lieu of the Blue Ring. The Blue Umbrella becomes an Orange Umbrella 50% of the time. A Blue Bottle becomes a Green Bottle 50% of the time, although both have the same effect. And finally, the last 5 rows all work the same way. The item in the first column gets replaced randomly with the item in the second column (3/8, or 37.5%) or by the item in the third column (1/4, or 25%)...
In the editor window, you can click on any item of the left column, and the lonely button over the second column (with the Red Candy in the screenshot), which is a special case. A small panel appears with all the Special Items in the game. There are 28 Special Items in all, including the Crystal Ball and the Secret Door, which have no effect when used under circumstances other than the level 99 (and that part is hard-coded anyway). When you change an item of the first column, the second and third columns items change automatically to n+1 and n+2, "n" being the Item Code of the first column item. For example, the Item Code of the Blue Book is 0x16. So, the second column is Item 0x17 (Red Necklace) and third column is Item 0x18 (Blue Necklace)...