To solve this problem, we first need to define the decision variables and the objective function. Let's denote the number of small shelves as `x` and the number of large shelves as `y`. The objective is to maximize the total number of action figures that can be stored, which is given by `20x + 30y`.

The constraints are:

1. Space constraint: The total space occupied by the shelves should not exceed 100 sq ft. Since a small shelf takes 3 sq ft and a large shelf takes 6 sq ft, this constraint can be written as `3x + 6y <= 100`.
2. Budget constraint: The total cost of the shelves should not exceed $1250. Given that a small shelf costs $50 and a large shelf costs $80, this constraint can be written as `50x + 80y <= 1250`.

We also need to ensure that the number of shelves is non-negative, so we have `x >= 0` and `y >= 0`. Since we cannot buy a fraction of a shelf, `x` and `y` should be integers.

The problem can now be formulated as a linear integer programming problem. However, since the objective function and constraints are linear, and the only non-linearity comes from the requirement that variables must be integers (which is common in such problems), we treat it directly with integer programming capabilities of Gurobi.

Here's how you could implement this problem in Python using Gurobi:

```python
from gurobipy import *

# Create a model
m = Model("Shelf_Optimization")

# Define the decision variables
x = m.addVar(vtype=GRB.INTEGER, name="small_shelves")
y = m.addVar(vtype=GRB.INTEGER, name="large_shelves")

# Set the objective function
m.setObjective(20*x + 30*y, GRB.MAXIMIZE)

# Add constraints
m.addConstr(3*x + 6*y <= 100, "space_constraint")
m.addConstr(50*x + 80*y <= 1250, "budget_constraint")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print(f"Optimal solution: Buy {x.x} small shelves and {y.x} large shelves.")
    print(f"Maximum action figures that can be stored: {20*x.x + 30*y.x}")
else:
    print("No optimal solution found.")

```