There seems to be no API for this. Maybe there is a way to speak directly to the GSM modem but even if it is possible one has to understand how the protocol (Phonet?) works.
dbus-send --system --type=method_call --print-reply --reply-timeout=666666 --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_available_network