A quadcopter contains (among other things) two separate and independent algorithms: an attitude estimation algorithm, and a control algorithm.
The attitude estimation algorithm computes information about the orientation of the quadcopter: the roll, pitch and yaw angles.
The control algorithm is responsible for driving the motors so that the orientation of the quadcopter matches what the pilot (or the autopilot software) expects. This algorithm is what would read the estimated quadcopter angles (from the attitude estimation algorithm) and change the motors speed to attempt to match the desired angles. PIDs are a well-suited and common control algorithm for quadcopters.
Gimbal lock is a phenomenon which may happen in the attitude estimation algorithm. It has nothing to do with the control algorithm. As such you don't need ESCs, motors or propellers to test for gimbal lock: you could modify your code to display your roll, pitch and yaw angles, and test that the correct values are calculated as you manually move your quadcopter around. You might be able to do this with the quadcopter tethered to your computer, via Bluetooth, or using other methods depending on your platform.
If the angles are calculated correctly you don't need to worry about quaternions. If they are not calculated correctly, quaternions might help you. The attitude estimation algorithm shall output 3 angles for the control algorithm to use, however it might use a different internal representation such as quaternions or 3x3 matrices. In that case it would still convert the attitude information to angles so as to provide usable data to the control algorithm. Generally speaking quaternions are unintuitive but computationally efficient. This makes them well suited for slow platforms such as Arduino. Matrices or angles may be an easier choice for faster hardware. If you need me to elaborate on one solution or the other please let me know, but it would be quite premature for me to give details at this stage as I am not convinced you need to implement quaternions.
Finally if the angles are calculated correctly the way to make your quadcopter loop is to control the angular rate rather than the angle. If your sticks represent the quadcopter angle there is no way to make it do a full loop: try to visualise the sticks position as the quadcopter loops and you should understand why. However if the sticks control the angular rate then you can control the speed at which it loops.
Good luck with your project!
Note: For the sake of simplicity I have not mentioned the theoretical option to manipulate the data as matrices or quaternions both in the attitude estimation algorithm and the control algorithm. I have never seen a quadcopter implementing such algorithms.