Having served in the military myself, I can tell you right now that answer was wrong back then, and it's wrong now. When the military moves you under orders, be it PCS or TDY they reimburse you all of those expenses that would otherwise be deductible on your tax return. So for a military member to have deductible moving expenses is not rare, but it is rare for the portion the military member paid out of their pocket to be a qualified moving or travel expense.
While the technicality of the provided answer is correct, it is not correct for you.
You were not under official orders to return home while you were stationed away from home on TDY orders. More than likely you were on military leave. All travel expenses, to include lodging and meals, while on leave are never a deductible expense unless that leave is in conjunction with military travel orders. If you returned home upon completion of the TDY the military paid you for that official travel. The stop off to see family is not official and therefore not deductible.
If you doubt me on this (and you should since I've been out of the military since '98) then I strongly encourage you to seek the advice of the tax lawyers that are manning the base legal office this time of year. It's absolutely free to you. All you gotta do is call and make an appointment. Appointments for those filing single are generally 15-30 minute time slots, while for married it's a 30-60 minute timeslot. You only need a 15 minute time slot for this.
Additionally, practically all base legal offices have extra staff on hand Jan -Apr who have been specifically trained and educated on all tax situations concerning military and their dependents. So if the base legal office disagrees with me, please get me a phone number to call so I can call your base legal office to see where they are getting their info from. I got my info from the CPAs (who were prior military) at my local Retiree Activities Office on Jacksonville Naval Air Station, FL.