Driving the magnetic phase transition of graphene nanoribbons with fluctuation fields and doping