Actually you could replace the whole of:
officer unassignVehicle
u1 unassignVehicle
u2 unassignVehicle
u3 unassignVehicle
u4 unassignVehicle
u5 unassignVehicle
u6 unassignVehicle
officer action ["eject",boat]
u1 action ["eject",boat]
u2 action ["eject",boat]
u3 action ["eject",boat]
u4 action ["eject",boat]
u5 action ["eject",boat]
u6 action ["eject",boat]
With:
{unassignVehicle _x;_x action ["eject",boat]} forEach [officer,u1,u2,u3,u4,u5,u6]
What that will do is unassign and eject each of the units in the list
It saves typing and so reduces the chance of a typo.
If all those units are in the same group then it gets even easier:
{unassignVehicle _x;_x action ["eject",boat]} forEach units group officer
I would not call a unit officer though - just in case it has a special meaning in OFP.