You are unfortunately, doing this very wrong. Stop ripping up the carpet and the floorboards, and the plumbing...
What you need to do, is make a device template for your set top box. See the DCT6412 device template for details. Define all of the commands that it has, and create little ruby snippets for them (usually <$"string to send"$>).. Once this is done, you can hook it up in the setup wizard, and MythTV will do the right thing.
Ok thanks thom, give it a go when I get home