How does fuel get to the engine during acrobatics?
The basic problem is that no matter how the aircraft's fuel tanks are designed, if there is an air gap in the tank, then there is an attitude and/or a g-loading that puts that air gap over the inlet to the fuel line running to the engine.

There are a lot of solutions to this problem. The first is exactly as you say; don't sustain any maneuver that starves the fuel pump (and by extension the engine) for a longer period than you have fuel in the lines to feed the engine. You can actually do a lot without the fuel system seeing a single hiccup in supply; the fuel tanks are designed to feed while under positive G-load (otherwise you couldn't get any fuel to the engine just sitting on the tarmac), so hard turns, rolls, loops etc that keep a force on the aircraft and its contents acting downward towards the floor of the cockpit will keep the fuel flowing into the engine. Spins and high negative-G maneuvers tend to be the things that starve the engine; if the tanks are in the wings, a hard spin, snap roll or zero-g parabola will push the fuel out away from the inlets at the wing roots.

Most fuel systems except on the lightest aircraft have at least two fuel pumps per engine; one electric pump on the tank side to shove fuel into the line, and one crankshaft-powered pump that draws fuel out of the lines into the carb chamber or other fuel delivery system. The checklist often involves turning on the electric fuel pumps just before startup to prime the fuel lines, then turning them off once the engine is running smoothly, but you can keep the electric pump on if you plan on really twerking the aircraft in flight. The line between these two pumps actually holds a fair amount of fuel, plenty for a minute or more of sustained operation with the inlet at the tank totally starved, and coupled with a bleed valve on the engine side to release any air that's entered the line, the two pumps running together can usually keep an uninterrupted flow of fuel into the engine by having the electric pump shove fuel down the line as fast as it can whenever the inlet is under the liquid level.

For mild aerobatic maneuvers, a "flop tube" is put into the fuel tank. This is simply a flexible hose with a weight, that keeps the hose under the liquid level, no matter what forces are acting to move the mass of liquid around in the tank. This is a simple and very effective way to keep fuel flowing to the engine while the aircraft is under load in any direction, but because the flop tube requires a significant volume of fuel to sink underneath and draw from, flop tubes can increase the "unusable fuel" capacity of the aircraft (fuel that exists in the tank, but the fuel system can't draw out in some normal circumstance). However, there's a tradeoff; the heavier the weight on the end of the flop tube, the more reliably it will stay under the fuel level regardless of attitude, but the more force with which it will impact the sides of the tank in violent maneuvers (and padding the weight further increases unusable fuel).

For the real aerobatic nuts, though, the maneuvers are so violent and so long that even a flop tube, redundant fuel pumps and bleed valves might get starved as the fuel sloshes and churns and there isn't a real "liquid level" to draw from. Many of these aircraft go one step further; a bladder-style fuel container. Within the fuel tank is a flexible polymer vessel that actually holds the fuel (typically in either wingtip tanks or a fuselage tank; it's usually impractical to try this with in-wing tanks). This bladder keeps the liquid and gas in the tank shell separate as the tank empties, and may also keep the fuel under some static pressure. If there's no air to draw into the fuel lines, then no matter how the aircraft is oriented or how many Gs it's pulling in any direction, the fuel lines can't be starved.

Of course, the fuel lines are only one consideration. Most "normal"-rated aircraft have float-type carburetors, which hold a reservoir of fuel with another air gap, and the fuel level in the reservoir is controlled by a float that opens the inlet from the fuel pump (this system also deals with small hiccups in the fuel flow from the tanks; the air just forms part of the air gap and the float keeps the inlet open until fuel flows in to raise the level). This type of carb will starve the engine during any maneuvers involving less than 1g of force acting towards the "floor" of the float chamber, as the float will keep the inlet closed and the reservoir will starve the fuel feed tube that allows fuel to dribble into the throttle body at the throat. For aerobatics, either a diaphragm-chamber carb (which has a flexible wall on one side of the reservoir chamber that is connected to the fuel inlet) or a fuel injection system must be used to avoid dependence on gravity to get fuel into the engine. The downside of these systems are increased complexity, and in the case of the diaphragm-chamber carb, intolerance of air this far along the fuel system (requiring an air bleed to purge any bubbles in the line before the fuel enters the reservoir).