algebra my friend...one of the few useful levels of math past elementary
x = desired new agv price
y = original # of shares you own
c = your current avg cost/share
z = # of new shares you need to buy
n = new price you're considering buying at
your example would never work as you can't avg down to the current lower price while having shares above the current price, but the formula is
x = (yc+zn)/(y+z) ---> solve for Z
if you had y=15 shares at c=$1.2/share, you want to buy z shares at $1.05 for a desired new avg of x=$1.1
1.1 = ((15*1.2)+ 1.05z)/15+z...z = 30 shares you'd need to buy @ 1.05 to average down to 1.1
Yes i typed all that out because i'm a nerd