score:2
Although you have good intentions, business visa purposes are outlined in this State Department pdf document...
And they state specifically that you cannot accept income from a US based company/entity while visiting on a B1 visa.
Purpose of Your Travel
Conference, meeting, trade show, or business event attendee
About Your Temporary Visit
Will receive no salary or income from a U.S based company/entity. For scientific, educational, professional or business purposes.
Your best bet is to obtain the proper business visa. That is also outlined in the same pdf document:
Purpose of Your Travel
Employment/work
About Your Temporary Visit
Payment, income, salary will be paid to you by U.S. based company or business entity.
Type of Visa
Temporary Worker Visa (H, L, O, P, Q visas and more)
Key Steps – What You Must Do
U.S. employer files petition with USCIS. After petition approval, visa application at U.S. Embassy or Consulate.
And to answer your question...
With my B1 Visa am I legally OK to do work in the US for a US based company as a foreign-based employee? Or as a foreign-based contractor?
If you are receiving income/payment from the US company, then no, you are not allowed to work inside the USA on a B1 visa. You need to have your employer sponsor the correct business visa for you. The State Department suggests petition based H, L, O, P, Q visas.