Hello Anna, and welcome to the forum.
To put the town guards into context :
- Orange Free State forces invaded Cape Colony in December 1900;
- from January 1901 onwards, town guard units were formed in most of the towns, to act as first line of defence in the event of a Boer attack;
- dozens of town guard companies were raised in Cape Town and the other towns and villages on the Cape Peninsula, such as Green & Sea Point, Woodstock, Rondebosch, Claremont, Wynberg, and Simon's Town;
- Cape Town alone raised a few dozen units, some recruited from municipal departments, large businesses (e.g. Stuttafords and Garlicks department stores) and ethnic communities (Caledonian and Hellenic);
- the authorities organised these units into five battalions, collectively called the 'Cape Peninsula Regiment'; artillery volunteers were formed into the Peninsula Artillery, and mounted volunteers formed the Peninsula Light Horse;
- the CPR was disbanded early in 1902, except for a small full-time element which was named the 'Cape Infantry' and continued to the end of the war.
I'm not sure where 33B (Engineers) Company recruited its members -- possibly the City Engineer's Department.
What William Long might have done during his service in the town guard is probably a fair amount of training, parades and shooting practice, but no action. The Boers did not attack Cape Town -- the nearest they came was Bellville, about twelve miles away, where a patrol was spotted one night in November 1901.