Ok, this turns out to be fairly straightforward.
The trick is to use Illustrator's prolouge and definitions.
In other words, don't create "empty" LB and Lb etc procedures, but use Adobe's.
Lb begins a layer. LB ends a layer. Lb expects 6 numbers, all of which are eventually thrown away. One of them however, toggles (I think) text vs. path. It's 0 or 1. Step through the "6 1 roll" to see which number it us. The rest can be dummy numbers for what we need.
You can put your own PostScript code in the layer, just make sure to use Illustrator's redefined operators instead of the "real" operators. "m" instead of "moveto", "c" instead of "curveto", etc.
So code to add a rectangle in a new "3rd layer" in an existing two layer Illustrator EPS might be:
Code:
%AI5_BeginLayer
1 1 1 1 0 0 0 255 255 255 Lb
(Layer 3) Ln
123.8193 64.208 m
63.7358 64.208 L
63.7358 103.917 L
123.8193 103.917 L
123.8193 64.208 L
F
LB
%AI5_EndLayer--
This is just quick and dirty, you'd need to do a lot more research in how to do fills vs. strokes, what to do for colors, making sure that the file works as expected both in Illustrator and when interpreted/printed, and so on.
But it can be done! Let me know if you need any more help.
Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting