I solved it using a function that looked at the neighbors and assigned a different tile depending on the neighborhood value.
This image is from a game I was preparing for a game jam, but I didn't manage to finish it and therefore didn't present it. Logically, it generates an ASCII map where a "logically" wall is transformed into a different graphic tile depending on whether or not it has "floor" surrounding it.
