I have found a workaround solution with the help of Mathworks. If the In Bus Element does not select any element, it outputs the bus. So you can clear the selected element, and then access the bus type, and restore the element after.
inports = find_system('bustest_model','BlockType','Inport')
handle = getSimulinkBlockHandle(inports(1));
elem = get_param(handle,'Element');
set_param(handle,'Element','');
bustype = get_param(getSimulinkBlockHandle(inports(1)),'OutDataTypeStr')
set_param(handle,'Element',elem);