aligntovector would be worthless and tform sounds like much more than needed as well.
Use the moveentity command and actually rotate your cube. That way the "z axis" will always be forward / backward and x axis always right / left
Use the moveentity command and actually rotate your cube. That way the "z axis" will always be forward / backward and x axis always right / left