metadata.db is a sqlite3 database. All the code for it is open, see libermetadb. The Scribbles are stored as "blobs" (generic binary data) in the "annotations" table:
CREATE TABLE annotations (
annotation_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
annotation_type TEXT NOT NULL,
file_id INTEGER NOT NULL,
layer TEXT NOT NULL,
file_position INTEGER NOT NULL,
Presumably the blob is what you need to put into a .note file after finding the right annotation record.