A base on the Costa del Sol, with a few days on the Rock
Most visitors walk or drive in from La Línea, often from a holiday base somewhere between Málaga and Sotogrande. If your plan is from the EU, it keeps working in Spain as at home, so what you need is data for the hours on the Gibraltar side. The 3 GB pack fits that: it lasts 15 days from its first connection in Gibraltar, so a second or third visit in the same fortnight runs on the same pack.
Use the phone's two lines for it. In Gibraltar, make the eSIM your data line and turn off data roaming on your own SIM, so it cannot run up data charges if it latches onto GibTel. Back in Spain, swap them. The 5 GB pack lasts 30 days, which suits a month in the area with regular trips across. Near the fence, if the data stops, choose GibTel by hand: the Gibraltar pack only works on that network.