When you enter the zone, you will appear on a dock with the Smarmy Sprocket ship behind you and Heron Cogspinner and Sparrow Cogcarrier directly in front of you. If you don't move from this spot when you zone in, the pirates on the dock should not attack you. However, be aware that the pirates are flagged to see you through invisibility / sneak, even if the red highlight denoting aggro disappears. Therefore, you must fight a ways through before you will be able to begin the quest.
Although the quest in your journal may "scale" numerically, the encounters do not. So it is best to chronomentor down to 30 if you have outleveled the zone so you can get experience and AA from the named.
Take the doorway to the left of the fireplace (north) into a deeper part of the prison.
Right-click Ol'Greasy at the end of the hallway of prison cells and take the keys you find. Be prepared to kill the jailed pirates immediately once you take the keys.
Return to Cap'n Cog's cell and speak with Admiral Grimgadget.
Take the doorway to the right of the fireplace (east) and kill Captain Jihannum in the first cell on your right in the hallway. Be prepared to kill the jailed pirates in the other cells once you start attacking the captain. You will have to click the first door on the right to be able to kill Captain Jihannum.