It turns out that I didn't exactly understand how XMPP worked, but I continued to work with an engineer on the IM side (who luckily understood programming, so I could send him my scripts for comments as well), and the following script seems to be working.
Take care all,
Rick
when CLIENT_ACCEPTED {
SSL::disable
TCP::collect
}
when CLIENT_DATA {
set clientdata [string tolower [TCP::payload]]
if { $clientdata contains " TCP::respond ""
TCP::payload replace 0 [TCP::payload length] ""
TCP::release
SSL::enable
} elseif { $clientdata contains " TCP::respond ""
TCP::collect
} else {
TCP::collect
}
}