Don Gifford is quite right to identify the phrase “unlawfully watching and besetting” (spoken by the First Watch) as “legal phraseology”. But we can be more specific.
The two words watch and beset have been paired in English since at least the sixteenth century. At first the expression was not specifically a legal phrase:
If he that lieth in waite of thee, haue commaunded to watch and beset thy house, and thou hast escaped, geue thankes vnto God and in the tables of thy soule, graue the thinge, and say the 59. Psalme.
Thomas Sternhold Treatise in The whole booke of Psalmes collected into Englysh metre (1562), sig. A.i.
Watching and besetting continued to occur in similar contexts into the nineteenth century. Examples include the following:
How am I watched and beset with evill spirits? how contumeliously traduced? how disdainefully lookt upon? how dragging the same chaine with the worst malefactors?
Joseph Hall The Free Prisoner in Three Tractates (1646), sect. 9 p. 132
The being used, for so many years, to be guided by these two men, was like a chain of iron that fastened me to them; besides, I was watched and beset by them continually.
tr. Francois Salignac de la Mothe-Fenelon Adventures of Telemachus (1776), vol. 2 bk 13, p. 64
There was also a subcurrent of quasi-legal use. This letter (written in 1757, but not published till 1831) places watching and besetting within a legal context:
The first search was by two Justices of the peace, with a Pursuivant, and others whom they brought with them to watch and beset the house.
Catholic Magazine September (1831), p. 481
The usage Joyce references arose out of political discussions in the 1870s. There was considerable unease on the part of the civil authorities over aggressive picketing organised by trade unions. Legislation was devised, and an amendment to the Criminal Law Amendment Bill (1871) was adopted by the House of Commons which:
makes it penal to watch and beset others, [but] is in the opinion of the [trade-]unionists, "fatal to all possible efforts on the part of the Unions to give information to imported workmen, or those coming from a distance, in case of any strike".
Empire (Sydney, New South Wales) (1872), 20 March p. 2
But despite the popular usage, the Act in fact uses the expression “watch or beset”:
A person shall, for the purposes of this Act, be deemed to molest or obstruct another person in any of the following cases; that is to say, […]
(3.) If he watch or beset the house or other place where such person resides or works, or carries on business, or happens to be, or the approach to such house or place, or if with two or more other persons he follow such person in a disorderly manner in or through any street or road. (Section 1)
The older use was still in evidence, as this quotation for William Cates’s History of England shows:
As if bent on the conquest of the country, he collected a large army in which Englishmen as well as Normans served, and sent a fleet to watch and beset the coast. (p. 55)
In 1875 the expression watching or besetting found a more prominent place in the statute books, in the Conspiracy, and Protection of Property Act of 1875.1 The act was significant in that it effectively legalised picketing and decriminalised the activities of trade unions. Section 7 contains the relevant clauses:
Every person who, with a view to compel any other person to abstain from doing or to do any act which such other person has a legal right to do or abstain from doing, wrongfully and without legal authority, […]
4. Watches or besets the house or other place where such other person resides, or works, or carries on business, or happens to be, or the approach to such house or place […]
shall, on conviction thereof by a court of summary jurisdiction, or on indictment as herein-after mentioned, be liable either to pay a penalty not exceeding twenty pounds, or to be imprisoned for a term not exceeding three months, with or without hard labour.
Attending at or near the house or place where a person resides, or works, or carries on business, or happens to be, or the approach to such house or place, in order merely to obtain or communicate information, shall not be deemed a watching or besetting within the meaning of this section.
But even here, and despite common usage, the legal usage links the terms with or and not with and. Joyce’s expression is “unlawfully watching and besetting”, and this precise wording is not enshrined in the law.
From 1875 newspapers carry references to the expression, notably in the context of the “Erith picketing case”, using both and and or. In the following example, the newspaper prefers and:
Most certainly, watching and besetting, unless it is only for information, is illegal.
South Eastern Gazette (1876), 17 July p. 4
The use of and for or was established in earlier, non-legal uses. The addition of “unlawful” by way of explanation occurs in the newspapers soon after the 1870s act:
George Nash, a boot-fitter, surrendered his bail, and was charged on remand with having unlawfully watched and beset certain premises, with other persons, with a view to intimidate certain workpeople from doing an act which they had a legal right to do.
Standard (1881), 28 October p. 2
"Watching and Besetting" a Baker’s Shop. – At Clerkenwell Police Court yesterday afternoon, four operative bakers on strike were charged with unlawfully watching and besetting the house and shop of George Fielder, master baker, who had refused to concede the strikers’ demands […] [The Magistrate] fined each defendant 40s., or fourteen days' imprisonment.
1889 Scotsman 5 December p. 7
The “legal phraseology” which Joyce slips into his dialogue in Ulysses derives from political discussions originally held in the 1870s, but as is often the case it has been filtered through the popular newsletters of his day.