Heat the oil in a heavy-bottomed Dutch oven over medium-high heat and, when hot, add the flour. Whisk to combine and continue to cook, stirring constantly, until a medium roux is formed (it should look a bit darker than peanut butter), about 10 minutes.
(If the roux begins to brown too quickly, reduce the heat to medium or medium-low and take your time—it is important that the roux not be burned at all or the stew will have a bitter taste.) As soon as the roux is the right color, add the chopped onion and cook until soft, stirring occasionally, 4 to 6 minutes.
Add the garlic and cook for 2 minutes. Stir in the stock, little by little, and bring the sauce to a gentle boil. Add the bay leaves, black pepper, cayenne, thyme, and 4 teaspoons of the salt and reduce the heat so that the sauce just simmers. Cook, stirring occasionally, until the floury taste is gone, 30 to 45 minutes.
Add the potatoes and continue to cook, uncovered and stirring occasionally, until the potatoes are very tender and the sauce is thick and flavorful, 30 to 40 minutes longer. (Add a bit of water or chicken broth to thin the gravy should the stew get too thick during the cook time. The sauce is meant to be thick and rich but not pasty.)
Toss the shrimp with the remaining ½ teaspoon salt. Stir the shrimp, green onion, and parsley into the stew and continue to cook until the shrimp are just cooked through, 3 to 4 minutes. Taste and adjust the seasoning if necessary. Remove the bay leaves. Serve the stew in shallow bowls over hot white rice.