Yes, the form box does appear to do what I want, but it is in linear form as per sixchannel's answer. The resulting leadsheet seems to be linear too, which is not very convenient if you want to produce something on one sheet for display on a tablet.
What I was looking for is a repeat of A with 2 endings followed by the B (middle 8) then a d.c. to the A part again with a coda sign to avoid the 1st and 2nd repeats but going to an ending instead. That's how I'd write it, old school style. Is possible in BIAB?