The easiest way to do this is to manage this in the tilemap stage. You paint in the core tile. So... you if you have grass and mud, with all the possible corner pieces (13 if I remember correctly) - you only ever use the center piece. Your map should now look like its made of solid grass and solid mud.
Once this is done, you write a script to run through your tilemap, and based on the tile you are on, and the 8 adjacent tiles, you pick the appropriate transition tile and replace that tile. Because this is a one off process, you basically have a big lookup table that tells you the best tile to pick based on the surrounding tiles.
To reiterate - You use the existing tools to paint solid values in, and then write a custom script to convert the solid tiles to the edges, etc.