I doubt there is anybody on this board who dives in low viz who hasn't been lost sometime.
But this is an excellent teaching experience in a lot of ways. First off, when you look at doing a dive like this, you have to think through the process. You have an anchored boat, so you need to get back to it, which means that losing the anchor line or boat is (or can be) a very bad thing. That sets your first priority, which is to remain cognizant of the way back to the anchor at all times.
Second, you have low viz -- you may not have known this on the boat, but you knew it as soon as you got into the water. When you combine low visibility with the need to get back to your starting point, it immediately calls for a more conservative navigation plan. This is why people are talking about running lines -- but you don't have to run line, if the downline is on the wreck. (If it's off the wreck in the sand, running a line from the anchor site to the wreck might be a good idea, but running line IS a skill you have to learn.) The dive briefing should have given you an idea of the shape and size of the wreck, and the depth of the various parts and the sand. If you were tied into a permanent mooring, the briefing should have included where that mooring is anchored; if a shot line or anchor was dropped on the wreck, they should have been able to tell you if it was at one end or the other, or the middle.
Once you got down, you should have marked the depth of the upline and its reference to the wreck structure. If you follow the structure in one direction, then you know that, if you retract your steps, you'll get back to where you were. If there is current, the direction of the current will give you a reference on which way you are going and where "home" is -- swimming into the current at the beginning makes it easy to get back when you are tired and your gas is lower.
When the viz is low and the anchor HAS to be found, any maneuver that risks losing your reference should be given quite a bit of thought. You may easily be able to go over the side on the side of the hull, especially on a side that is sheltered from the current, because you have a great big flat surface to stay close to. The bow and stern, as you learned, are a little more difficult, especially because the hull often recedes rapidly away from you below the tip of the bow, and you are exposed to any current there is at that spot. Thinking through what the water is doing and what kind of problems that could cause you will often avoid navigational difficulties.
Once you are off the wreck and not in accord as to where it lies, surfacing is the right action, and whether you can descend again depends on how deep you were, and how long you had been there. Controlling an ascent in midwater, in low viz, with no reference, and staying with your buddy is not always easy, and kudos to you for pulling it off. Your particular situation, where the wreck was reasonably shallow, is one where I would definitely consider omitting the safety stop, simply because, once you have no reference, you have no idea how fast the water is moving you. (I had an experience where we were practicing no-reference ascents, and drifted so far while doing one that we surfaced right in the middle of a ferry lane!) You don't want to end up greatly downcurrent from the boat, because you may not be able to get back to it, and may drift a long time before they can retrieve all the other divers and come looking for you. This is one of the reasons many of us who dive off boats carry surface marker buoys and learn to deploy them at depth. It lets the boat know they have divers off the wreck, while you are still close enough for them to track you easily.
At any rate, like so many diving difficulties, there were some opportunities before you ever got in the water to avoid this one. Knowing more about the wreck and the water conditions, and agreeing on where you were going to go and what you were going to do, would have made it easier. Also, don't forget, especially when you are new like you are, to ask some advice from the boat crew! If you tell them you are brand new, they can often suggest a way of exploring the wreck that will make for a fun and easy dive.