The original question is posted in this thread. The OP wanted to query a category and sort based on the presence of a Custom Field. Posts in the category and with the CF were to sort ahead of those without the CF. Pagination of the results was also a requirement.
The solution is in this pastebin file.