I don't know your unit and these are just some things to consider. If you are going to do this I don't think any order is needed, just format the sd card (external) and format the internal one, I think on most tablets there is a place in settings then return the unit to factory in settings.
On the other hand, are you sure you know which card is external and which is internal? Some androids it isn't clear unless they are labeled as what they are in explorer. I have a couple older ones I can never remember which is which due to no labels.
I've also read that though the option of moving apps around is present, it doesn't always work that well.