The 32/64k limit applies to all events within an object. An object is anything with its own events. Buttons, forms, fields, and agents are all separate objects and have their own 32/64k limits.
For example, if you have code in the QueryOpen, PostOpen and QuerySave events within one form, all these count toward the form's 32/64k limit because they are all events for the form object.
Since there is no way to do a design synopsis which includes script, there is no easy way to figure out if you are at or near the limit. The only thing you can do is copy all the script from all the events for a particular object into a text file and then look at the size of the text file. This should APPROXIMATE the amount of compiled code (this is not a precise measure however).
There are several possible ways to work around the problem depending on where you are running into the limit.
1) Put the script in an text file and use the LotusScript %include command to load it. This script is not counted toward the memory limit. This is definitely the best workaround.
2) Put pieces of the script in entering events of hidden fields and use the LotusScript GotoField method to trigger the scripts.
3) Put additional scripts in subform events and embed the subforms in the form running into the memory limit. For example, if you're running out of space in the form object and wish to place more script in the PostOpen event, create a subform, place the desired code in its PostOpen event and insert the subform into the form.