This phrase or varients "yippy ki yi yay!" originated with 1880's western U.S. cowboys while herding cows. I think the intent by Willis' character, was to imply that quality of acting entirely on one's own, outside of the normal modes usually expected. Somehow, over the years, the term "cowboy" has become as much a description of willful, somewhat reckless action as it is of the individual herding cows. Thus it is used in these series of movies...
The phrase was also related to Willis's earlier reference in the movie to Roy Rogers, the great Western cowboy star/country singer and his assumption of the 'codename' Roy when in radio contact with the policeman. Roy Rogers often sang similar cowboy phrases in his genial songs.