When I read your requirements correctly, a combination of two Firefox addons could do the job:
Markdown Editor allows you to open/create, edit, and save Markdown documents – using a syntax you're already familiar with from Stack Exchange. This would include e.g. nested lists and hyperlinks:

Markdown Editor (source: Mozilla.org; click images for larger variants)
As the second screenshot shows, the addon's split view feature would allow you to "click" those links. To make "capturing" links easier, I'd recommend a second addon:
CoLT (short for "Copy Link Text") makes it easy to copy either a link's text, or both the link text and its URL in a format you specify. This non-invasive extension simply appears as context menu items when you right-click a link. Fully customizable!

CoLT (source: Mozilla.org; click images for larger variants)
I use CoLT myself for years already – and I use it a lot in a similar way as I'm suggesting here: to insert links into Markdown documents (only that most of those Markdown "documents" are answers on SE sites), so I can at least vouch for this part.
Edit:
As akavel pointed out in the
comments, there's also Easy
Copy –
which somewhat acts like "CoLT on steroids" (much more configurable
and feature rich). Make your own choice here :) For example, with Easy
Copy you can configure to get a selected fragment of text from a
website into clipboard too, using the following snippet:
* [%page_title%](%page_url%) (%date%)
> %selection%
Now let's see how my combination matches your requirements:
- Must be offline (does not store bookmarks "in the cloud"): Check.
- Must handle thousands of bookmarks (acceptable limit is about 5000): you didn't specify across how many documents they can be split, so: Yes, at least when spread about several documents :) Not sure if the editor has a limit – and if, where it lies.
- Gratis or very low cost: Gratis, but donations accepted (both addons)
- Windows compatible: I cannot test that currently – but at least for CoLT the answer is a definitive yes (have used it on Windows already when at my customers' places)
- The functionality of a bookmark must include storing a URL that, when clicked, opens a web site: Yupp, see "split view".
Conclusion: If it's acceptable to use two addons to accomplish the task, these two should do. If not, CoLT could be substituted by (Easy Copy and/or) additional handiwork :)