Oh, my bad. I was reading it all too quickly to even realize the line I had you change only changes the logs and not the actual bet. That's why it worked on simulation mode (which is what I tested it on), and not with real money. Instead of the above change, reset your script back to default and then make the following change below. This should then work with real money.
Line 16 should look like this:
const wager = Math.min(bettableBalance, bet.wager, config.maxBet.value);
Change "bet.wager" to "bet.wager / x", where x is the fraction of the target's bet you want to make. So for a 2% bet, your line would look like:
const wager = Math.min(bettableBalance, bet.wager / 50, config.maxBet.value);
Line 23 should look like this:
engine.bet(wager, bet.payout); // aim at target's payout
Change it to the following:
engine.bet(Math.floor(wager / 100) * 100, bet.payout); // aim at target's payout
This will round your number down to the nearest whole number of bits to stop you getting the "Bet is not a valid integer" error if your percentage chosen above results in a fraction of a bit.