There are several words that can be used as synonyms for the phrase "walked up and down". These include pacing, strolling, roaming, meandering, sauntering, and ambling. When someone is pacing, it typically indicates a sense of restlessness or agitation, as they are moving back and forth in a small area. Strolling and sauntering suggest a more leisurely pace, while roaming and meandering imply a more aimless or wandering journey. Ambling, meanwhile, describes a slow and relaxed walk without much direction. The particular word used will depend on the context and the feeling the writer or speaker wants to convey.