Right now, you need time, and going into the nebula to make what repairs you can makes the best tactical sense. You still have working sensors, which are better than the pirates' gear, so you will see them coming long before they get there by dropping a relay just outside the nebula relaying sensor data to the ship. If you have shuttles which are or can be more heavily armed, place them on each side of the ion trail you are going to leave (and the pirates will follow) and ambush them, quick striking the pirates then retreating into the nebula, where your superior sensor capability will give you the advantage. If the shuttles can continue to keep the pirates in a running battle, whittling them down, then you come out with what ever weapons you have online to finish off whoever is left, or watch them retreat, or demand their surrender. Pirate vessels are not built for long running battles, and they have lost the advantage of surprise. Most likely at that point, they will retreat after taking such losses.