Is there a way, in a Lua script, to completely control the shooting irrespective of the Canon settings.
For example, if I set the Canon side AEB on, say to three brackets, and use shoot() in Lua, I will get three bracketed images.
The question is, how can I keep the Canon AEB setting but by pass it in my script and use shoot() as a single image capture.
Not clear what you are trying to accomplish, but a few things to note:
1) Most CHDK cameras do not support bracketing in the Canon firmware, so it is likely that the interaction between CHDK and Canon bracketing is not well explored. To my knowledge, there is no specific expected behavior defined for the case of using Canon bracketing with shoot(). There is a camera.h define CAM_BRACKETING for cameras with native bracketing (dating from the very early S / G series), but I don't believe it does anything related to shoot(), and in any case it's not defined for the M cameras.
2) shoot() is intended to be a simple, high level function to do a full shooting cycle of half press, wait for everything to be ready, full press. Normally this would be expected to shoot a single shot, but again, I'm not aware of any specific behavior defined for Canon firmware multishot modes like bracketing or HDR. CHDK does have some logic related to multi-shot timer modes, to support CHDK bracketing in those modes.
3) If you want more direct control of the shooting process, you can use key presses and
shoot hooks. In particular, hook_shoot should allow you to execute code before each exposure starts, and hook_raw should allow you to execute code after each exposure has completed. However, it's possible that these hooks aren't correctly implemented for more obscure code paths like Canon multi-shot modes.
Generally speaking, I would suggest if you want to do bracketing in a script, you would be better off using CHDK functionality rather than trying to integrate it with Canon native bracketing.
If you do want to use Canon firmware bracketing, it will be up to you to explore it interacts with CHDK.