hello there
that seems like a good idea , you're very welcome to visit morocco
1- about ferries and since you prefer to shorten your trip i would strongly recommend
Tarifa- tanger ville (which docks in city port instead of a 1 hour far away tanger med port) , you can get roundtrip from FRS which operates the route
also keep in mind that the city port is undergoing renovation
2 - safety concerns : you have nothing to worry about since morocco gets lot of tourism mainly from europe and shared LAND borders with spain so that makes it more secure than other arab country , i would however urge you to consult your foreign affairs's website for travel recommendation
have a great trip and do no hesitate to ask me anything