To solve William's problem, we need to formulate a linear programming model that maximizes the number of potato packages transported under the given constraints. Let's denote:

- $x$ as the number of regular truck trips,
- $y$ as the number of refrigerated truck trips.

The objective is to maximize the total number of packages transported, which can be represented as $70x + 100y$ since each regular truck can take 70 packages and each refrigerated truck can take 100 packages.

The constraints are:

1. The total cost must not exceed $5000: $50x + $70y \leq $5000.
2. The number of refrigerated truck trips must not exceed the number of regular truck trips: $y \leq x$.
3. Non-negativity constraints: $x \geq 0$, $y \geq 0$, since the number of trips cannot be negative.

Here is how we can translate this problem into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Potato_Transport")

# Define variables
x = m.addVar(vtype=GRB.CONTINUOUS, name="regular_truck_trips")
y = m.addVar(vtype=GRB.CONTINUOUS, name="refrigerated_truck_trips")

# Set the objective function: maximize the total number of packages transported
m.setObjective(70*x + 100*y, GRB.MAXIMIZE)

# Add constraints
m.addConstr(50*x + 70*y <= 5000, "cost_limit")
m.addConstr(y <= x, "refrigerated_truck_limit")

# Optimize the model
m.optimize()

# Print the solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Number of regular truck trips: {x.x}")
    print(f"Number of refrigerated truck trips: {y.x}")
    print(f"Total packages transported: {70*x.x + 100*y.x}")
else:
    print("No optimal solution found")
```