Can a plane with a thrust-to-weight ratio less than one fly vertically and perform loops?
With thrust/weight ratio above one, you can use the thrust of the engine to accelerate upward (at least at some point in the flight envelope).  As long as the engines can deliver full thrust, you can maintain that position.
Below one, vertical flight is still possible, but you will be losing speed in the maneuver.
Gliders are capable of loops without any thrust at all. The only energy in the maneuver is the speed of the glider on entry.