As you've no doubt found out by now, Painter does not yet allow for layer stack editing via the API. You won't be able to assign the input.
That said, the standard ID mesh map should already be assigned when the smart material is instantiated (assuming it was authored in a scene with a preview ID map)? Standard mesh maps shouldn't need manual assigned to Smart Materials inputs I don't think. Is this some other expected resource residing in the project, that is not the standard ID Mesh Map?