To solve Marty's investment problem, we need to maximize his average return given the constraints on investments in the wood and bamboo industries. Let's denote:

- \(x_w\) as the amount invested in the wood industry,
- \(x_b\) as the amount invested in the bamboo industry.

The total budget constraint is \(x_w + x_b = 10000\).

Marty also wants to invest at least four times as much in the wood industry as in the bamboo industry, so we have \(x_w \geq 4x_b\).

There's a restriction on investing at most $7000 in the wood industry, which gives us \(x_w \leq 7000\).

The returns from the investments are 7% for the wood industry and 3% for the bamboo industry. The average return can be calculated as \((0.07x_w + 0.03x_b) / (x_w + x_b)\), but since \(x_w + x_b = 10000\), we can simplify this to \(0.07x_w + 0.03x_b\) without dividing by the total investment, as it's a constant.

However, to correctly represent the average return in terms of maximizing it, we recognize that the actual goal is to maximize \(0.07x_w + 0.03x_b\), since the denominator (total investment) is fixed at $10,000.

Now, let's translate these conditions into Gurobi code:

```python
from gurobipy import *

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

# Define variables
x_w = m.addVar(lb=0, name="wood_investment")
x_b = m.addVar(lb=0, name="bamboo_investment")

# Set the objective function to maximize average return
m.setObjective(0.07*x_w + 0.03*x_b, GRB.MAXIMIZE)

# Add constraints
m.addConstr(x_w + x_b == 10000, "total_budget")
m.addConstr(x_w >= 4*x_b, "wood_at_least_four_times_bamboo")
m.addConstr(x_w <= 7000, "max_wood_investment")

# Optimize the model
m.optimize()

# Print results if an optimal solution is found
if m.status == GRB.OPTIMAL:
    print("Optimal wood investment: $", x_w.x)
    print("Optimal bamboo investment: $", x_b.x)
else:
    print("No optimal solution found. The problem may be infeasible.")
```

This code defines a linear programming model that captures Marty's investment constraints and optimizes for the maximum average return, given the conditions specified.