Not sure if you got this working in the meantime, but here's a possible solution:
Instead of using the DataRef function, use XPLMFindDataRef. When setting the values in your command simply use the XPLMSetDataf function.
cdu1_initref = XPLMFindDataRef("ixeg/733/FMC/cdu1_initref")
create_command("ixeg/733/FMC/cdu1_initref", "cdu1_initref", "", "XPLMSetDataf(cdu1_initref, 1)", "XPLMSetDataf(cdu1_initref, 0)")
Note that cdu1_iniref is of type float, hence why I'm using the XPLMSetDataf function, but you could also use the XPLMSetDatai function for integers. In this case it doesn't matter as all button datarefs are either 0 or 1.