I' thinking a ship like a cog, it generally only had 1 sail?
And if it was a busy port, would the port follow some kind of schedule?
I feel as though I should start with the standard disclaimer that the "medieval" period spans an enormous amount of time, so you're going to get a different answer depending on what part of the medieval period you've picked. However, since you've identified a cog as your target ship, that will help quite a bit.
So, a cog is a type of medieval vessel that generally speaking had one mast and one sail. (It's confusing to trace the provenance of medieval vessels because people who wrote chronicles often called everything by a generic name, such as "galley," or just "ship," but the cog is a type that much is known about.) It was in use roughly from the year 1000 to the mid-1400s or so.
The most famous cog is probably the Bremen cog, which was discovered in the 1960s in Bremen, Germany, and dates to around 1380. Here's a modern reproduction of the Bremen cog. As you can see, it's a pretty small ship -- most cogs seem to have ranged in size from about 50-80 feet long, with a beam of 15-25 feet. Cogs were often built with flat bottoms for ease of beaching in case there was no dock available. And they were often not decked at all, which meant that they simply had thwarts running from one side of the hull to another, with maybe a screen or hides or something of that nature over the cargo.
One of the major disadvantages of the single square sail was that it would only allow for ease of travel with the wind abaft the beam, so cogs were limited in long-distance travel, and it would have been extremely difficult to sail one up to a pier and tie up. So, like most medieval ships, cogs were small enough to be rowed if necessary. You wouldn't necessarily want to row one across the North Sea or anything crazy like that, but they would have been fitted with oars or sweeps (large oars) for ease of movement in harbor or across short distances.
Most likely, when a cog came into a harbor that was developed enough to have docks, it would drop its sail at some point and proceed under oars. Failing that, you could move that size of ship by towing it with a smaller boat (ship's boat or tender), or by a process known as "warping," in which you'd cast out a line to a fixed point on shore or to an anchor and draw the ship up to it by heaving on the line.
In terms of the economy of the medieval port, I'm out of my depth (I know more about dockyards in the military sense, which would definitely have schedules for dealing with crowding). The "harbor master" as a concept definitely existed by around the 1550s, but I can't speak with any authority as to what would have existed earlier.
I also should point out that the concept of the "dock" is one that took quite a while to develop; many medieval "ports" were often simply sheltered harbors where you could beach ships or transfer cargo by boat. We know that King John of England built a dock (exclusa) at Portsmouth in the early 1200s, which was essentially an area of water with a lock, so that his galleys could lay up in shelter regardless of the tides. It had a stone enclosure and a perimeter wall, possibly also of stone. Nothing else in the military sense existed quite so early, but I am at sea regarding commercial ports. I also should probably point out that in maritime use, the "dock" is the area of water next to a pier, wharf, or quay. So if you ever visit a port town, don't try to stand on the dock. :-)
I hope this helps; please let me know if you have any questions.