What kind of equation would best evaluate a rocket engine's performance in foreign atmospheres such as Mars?
Let's take a look at a simple model of the thrust generated by a rocket in an atmosphere:
$$F = \dot{m} \cdot v_e + (p_e - p_0) \cdot A_e$$
Where $\dot{m}$ is the mass flow, $v_e$ is the exhaust velocity, $p_e$ and $p_0$ the pressure at the nozzle exit and surrounding atmosphere, and $A_e$ the cross section area at the exit of the nozzle.
In a foreign atmosphere $p_0$ changes. But since we control $p_e$ and $A_e$ through nozzle geometry, those need to be retuned to the new conditions. For a thin atmosphere such as that of Mars, I would take a look at values from real life second-stage engines used on Earth. Those shouldn't be too far off.
Rocket nozzle design is a huge and non-trivial topic.
Do it matter that specific impulse does not consider air resistance?
It doesn't matter for the performance of the engine, but it clearly has a significant effect for the performance of the entire vehicle. Modelling just engine performance is not enough to conclude that a launcher is viable.
Aerodynamic rocket design and launch trajectory modelling is another huge and non-trivial topic.
How would one take into account the fact that gravity changes depending on where the rocket is, relative to the planet. For example, gravity decreases as you exit the atmosphere. Would you only calculate thrust to weight at certain points?
Thrust-to-weight at launch is the single most useful quantity here. Gravity doesn't change all that much from launch to orbit (the atmosphere is a thin shell), but it decreases a bit. The mass of the rocket on the other hand goes down significantly as it burns its propellant, so the TtW goes up over time. If TtW is good enough at launch, it is usually good enough for the entire trajectory.