Thanks so much. This is exactly what i needed! The toggle sound effect plays during execution. YES. 
Edit: This is ultimately the version i settled on because for some reason, keys.sendL() is skipping key presses in the game window, but works fine in every other window. Not sure what the issue is there.

/*/ ifRunning run; /*/
script.setup(trayIcon: !true, sleepExit: true, lockExit: true);
using var mutex = new Mutex(true, "mutex-BF6-spacebar", out bool createdNew);
run.thread(() => { sound.speak(createdNew ? "Toggle On" : "Toggle off"); }, background: false);
if (createdNew) {
WndUtil.CreateMessageOnlyWindow("#32770", script.name);
} else {
int id = wnd.findFast(script.name, "#32770", messageOnly: true).ProcessId;
if (id != 0) script.end(id);
return;
}
opt.key.KeySpeed = 15;
opt.key.NoBlockInput = true;
opt.key.NoModOff = true;
while (true)
{
keys.send("Space");
}
Having problems with quickly closing a macro