Although my main spec was resto, towards the end of Cata, I had both a kitty and bear set and also tried to manage this issue.
I have always believed the batch tools can play a role in this, but have never tried them.
Basically the biggest issue on joint optimisation is that you will need to decide the relative importance of the 2 sets and how those 2 scores (tank based scores and dps based scores) would be added together to get the a combined final score.
If you say that the main spec always outweights the secondary:
there is a special case that except for hit and expertise caps, the relative weights of stats typically don't change dramatically as your gear get minor improvements.Thus after your caps are sorted, everything would tend to be reforged to the best 2 stats
(reforge the weakest to the best, if the item already has the best stat, reforge the other stat to the 2nd best stat). If the 2 high priority stats are the same for the 2 specs, your lucky with lots of shared gear.
The approach would be to optimise the main and then lock all items (shift click to get blue diamonds), duplicates you can add extra as normal green diamonds and the extra gear in your bags. Then switch models and run optimiser to get the secondary gearset
sorted, while it figures out whether it is worthwhile to reuse some of your locked items or rather going with the older tier's items in your bags.
If the one spec isn't supposed to completely dominate the secondary spec and you have the issue that the high priority stats of the specs differ, you end up with compromises and ultimately need to decide how your willing to compromise on each side. Then
it almost becomes easiest to manually assign some compromised reforging or gemming options, lock them and the go back to the workflow described previously. Trying to really automate that is difficult since there really is no real answer in terms of how much
to compromise on each side.