(I've only spoilered the answer to the first question because the answers to the others were a bit too lengthy.)
1)
(I initially understood the percentage as referring to what percentage of all gumballs left in the machine are pink, but the OP's comment below the question indicates that it actually refers to the percentage of the original number of pink gumballs that are currently left, so I'm going with that interpretation.)
The machine begins by dispensing 1 pink and 1 green gumball for each penny, and continues to do this until there are 70% of the original number of pink gumballs left. 70% of 140 is 98, so this phase continues for 140 - 98 = 42 rounds, and so costs 42 pennies.
Then,
the machine then enters its next phase, wherein it dispenses 2 green gumballs for each penny, and continues to do this until there are no green gumballs left. The first round dispensed one green gumball per round for 42 rounds, so at the start of the second phase there are 100 - 42 = 58 green gumballs left. The second phase thus lasts for 58/2 = 29 rounds, and so costs 29 pennies.
Finally,
the machine enters its third phase, wherein it dispenses 1 pink gumball for each penny, and continues to do this until there are no pink gumballs left. After the first round, there were 98 pink gumballs left, and this remained unchanged during the second round, which dispensed no pink gumballs, so the third phase will last for 98 rounds, and so cost 98 pennies.
So,
Putting all the phases together, we have 42 + 29 + 98 pennies to release all the gumballs, which is 169 pennies.
2)
Let $N_p$ be the initial number of pink gumballs, $N_g$ be the initial number of green gumballs, $P$ be the percentage setting, $D_{p1}$ be the number of pink dispensed per penny in the pink-and-green phase, $D_{g1}$ be the number of green dispensed per penny in the pink-and-green phase, $D_{p2}$ be the number of pink dispensed per penny in the pink-only phase, and $D_{g2}$ be the number of green dispensed per penny in the green-only phase.
If $N_p$ is 0, presumably the machine will skip the pink-and-green phase, go straight into the green-only phase, continue till all green gumballs are dispensed, and then skip the pink-only phase as well. In this case, the number of rounds (and thus pennies), which we will denote by $R_2$, will either be the largest whole number such that $D_{g2}$ multiplied by that number is less than $N_g$ (sorry, I'm pretty sure there's a name for that, but my maths was a long time ago and I've forgotten it! Let's call it $L$.), or $L+1$. If $N_g$ is a multiple of $D_{g2}$, it will be $L$, and if not then it will be $L+1$.
If $N_g$ is 0, then (if $D_{g1}>0$) it is not entirely clear from the rules what happens: does the machine skip straight to the pink-only phase, or does it dispense the appropriate number of pink gumballs each turn for the pink-and-green phase, even though it cannot accompany them with the appropriate number of green gumballs, until the percentage of pink gumballs is reached? Assuming the former, the number of rounds and thus pennies (which we will denote by $R_3$) can be calculated in the same way as for the case where $N_p$ was 0, replacing all the $g$s with $p$s.
If $N_g$ and $N_p$ are both non-zero, then the machine starts in the pink-and-green phase. It is known that this will terminate when the number of pink gumballs remaining drops below $P$% of $N_p$. As already mentioned, it is not clear from the rules whether it also terminates when the number of green gumballs reaches 0, but we will assume that it does.
This issue does not arise in any case when $N_g/D_{g1}$ is greater than $100-P$% of $N_p$ divided by $D_{p1}$. In this case, the pink-and-green phase continues for $R_1$ rounds, where $R_1$ is the smallest number such that $R_1\times D_{p1}>(1-P/100)\times N_p$. At the end of the first phase, there are $N_p - (R_1 \times D_{p1})$ pink and $N_g - (R_1 \times D_{g1})$ green gumballs left.
If $N_g/D_{g1}$ is less than or equal to $100-P$% of $N_p$ divided by $D_{p1}$, then the number of rounds in the pink-and-green phase, which we will again denote $R_1$, is $N_g/D_{g1}$ if that is a whole number, and otherwise it is 1 + the largest number which when multiplied by $D_{g1}$ gives a value less than $N_g$.
If there are any green gumballs left after the first phase (i.e. if $N_g/D_{g1}$ is greater than $100-P$% of $N_p$ divided by $D_{p1}$), then the machine enters the green-only phase for a number of rounds which we will denote by $R_2$. If there are no green gumballs left after the first phase (i.e. if $N_g/D_{g1}$ is less than or equal to $100-P$% of $N_p$ divided by $D_{p1}$) then $R_2=0$.
If the machine does enter the green-only phase, then it will do so with $N_g - (R_1 \times D_{g1})$ green gumballs. For simplicity, let us refer to this number as $N_{g2}$. If $N_{g2}/D_{g2}$ is a whole number, then $R_2=N_{g2}/D_{g2}$. Otherwise, $R_2$ is 1 greater than the largest number such that $D_{g2}$ multiplied by that number is less than $N_{g2}$.
Finally, the machine will enter the pink-only phase, for $R_3$ rounds, provided that $N_p - (R_1 \times D_{p1}) > 0$ (if that is not the case then $R_3$ will be 0), and there will be $N_p - (R_1 \times D_{p1})$ pink gumballs at the start of this round. Let us call this number $N_{p2}$ for simplicity. $R_3$ can now be calculated in the same way as $R_2$ was, replacing $g$ by $p$ throughout.
The total number of pennies is then given by $R_1+R_2+R_3$.
3) and 4)
The price that you pay for the gumballs has no bearing on the dial-setting strategy. This is because throughout we have been assuming that the customer (or a steady stream of different customers) will keep inserting pennies regardless of how attractive to them the offer of a certain number of gumballs of a certain colour or colours is. Unlike in the real world, the fact that pink gumballs cost you twice as much as green gumballs do has no implications for how you should price them in the machine, because you don't have to worry that the customers won't go for inferior green gumballs offered at the same price as the pink ones, and you can just go ahead and set the $D_{p2}$ and $D_{g2}$ both to 1, and $P$ to 100, so that the machine enters the green-only phase right from the beginning, followed by the pink-only phase, and only ever dispenses one gumball for a penny; it does not matter what you set $D_{p1}$ and $D_{g1}$ to since these dials will never come into play. (This must be the strategy that maximises your revenue, since each turn must dispense at least one gumball, so there is no room for improvement.)
Similarly, for the least revenue, you need to maximise the number of gumballs released every turn, and if (as shown in the illustration) the dials governing the number of gumballs released all have the same maximum, then the way to ensure the most gumballs are released per turn is to have the machine stay in the pink-and-green phase throughout, so that you get the maximum number of each of two colours instead of the maximum number of just one, and so you must set $P$ to 0 and $D_{p1}$ and $D_{g1}$ both to their maximum possible values. (It does not matter what you set $D_{g2}$ and $D_{p2}$ to.)
The only thing you can change about your strategy which is determined by the cost to you of the gumballs is the number of pink and green balls you fill it with at the start, and the optimal and pessimal strategies are trivial: the optimal strategy is to fill it entirely with whichever colour is cheaper, and the pessimal to fill it with whichever is more expensive.
To summarise, your profit is how much more money you get from people inserting pennies into the machine than you spent in stocking it. You maximise profit by a) maximising the revenue from the machine, which means maximising the number of turns it takes to empty it, which is unrelated to how much each gumball costs you when stocking it, and b) minimising the amount you spend on stocking the machine, which does depend on the relative cost to you of the different colours of gumball.